Thread: [cedar-backup-svn] SF.net SVN: cedar-backup:[923] cedar-backup2/trunk
Brought to you by:
pronovic
|
From: <pro...@us...> - 2008-10-06 02:11:24
|
Revision: 923
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=923&view=rev
Author: pronovic
Date: 2008-10-06 02:11:17 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Add <ignore_failures> option to peer configuration.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/manual/src/config.xml
cedar-backup2/trunk/test/configtests.py
cedar-backup2/trunk/test/data/cback.conf.10
cedar-backup2/trunk/test/data/cback.conf.15
cedar-backup2/trunk/test/data/cback.conf.20
cedar-backup2/trunk/test/data/cback.conf.21
cedar-backup2/trunk/test/data/cback.conf.23
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-05-06 15:32:44 UTC (rev 922)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-10-06 02:11:17 UTC (rev 923)
@@ -111,8 +111,12 @@
stagingDirs = _createStagingDirs(config, dailyDir, allPeers)
for peer in allPeers:
logger.info("Staging peer [%s]." % peer.name)
+ ignoreFailures = _getIgnoreFailuresFlag(options, peer)
if not peer.checkCollectIndicator():
- logger.error("Peer [%s] was not ready to be staged." % peer.name)
+ if not ignoreFailures:
+ logger.error("Peer [%s] was not ready to be staged." % peer.name)
+ else:
+ logger.info("Peer [%s] was not ready to be staged." % peer.name)
continue
logger.debug("Found collect indicator.")
targetDir = stagingDirs[peer.name]
@@ -186,6 +190,28 @@
# Private attribute "getter" functions
########################################################################
+####################################
+# _getIgnoreFailuresFlag() function
+####################################
+
+def _getIgnoreFailuresFlag(options, peer):
+ """
+ Gets the ignore failures flag based on options and peer configuration.
+ @param options: Options object
+ @param peer: Peer configuration to check
+ @return: Whether to ignore stage failures for this peer
+ """
+ if peer.ignoreFailureMode is None or peer.ignoreFailureMode == "none":
+ return False
+ elif peer.ignoreFailureMode == "all":
+ return True
+ else:
+ if options.full or isStartOfWeek(config.options.startingDay):
+ return peer.ignoreFailureMode == "weekly"
+ else:
+ return peer.ignoreFailureMode == "daily"
+
+
##########################
# _getDailyDir() function
##########################
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2008-05-06 15:32:44 UTC (rev 922)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2008-10-06 02:11:17 UTC (rev 923)
@@ -272,6 +272,7 @@
VALID_ORDER_MODES = [ "index", "dependency", ]
VALID_BLANK_MODES = [ "daily", "weekly", ]
VALID_BYTE_UNITS = [ UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES, ]
+VALID_FAILURE_MODES = [ "none", "all", "daily", "weekly", ]
REWRITABLE_MEDIA_TYPES = [ "cdrw-74", "cdrw-80", "dvd+rw", ]
@@ -1794,29 +1795,33 @@
- The peer name must be a non-empty string.
- The collect directory must be an absolute path.
+ - The ignore failure mode must be one of the values in L{VALID_FAILURE_MODES}.
@sort: __init__, __repr__, __str__, __cmp__, name, collectDir
"""
- def __init__(self, name=None, collectDir=None):
+ def __init__(self, name=None, collectDir=None, ignoreFailureMode=None):
"""
Constructor for the C{LocalPeer} class.
@param name: Name of the peer, typically a valid hostname.
@param collectDir: Collect directory to stage files from on peer.
+ @param ignoreFailureMode: Ignore failure mode for peer.
@raise ValueError: If one of the values is invalid.
"""
self._name = None
self._collectDir = None
+ self._ignoreFailureMode = None
self.name = name
self.collectDir = collectDir
+ self.ignoreFailureMode = ignoreFailureMode
def __repr__(self):
"""
Official string representation for class instance.
"""
- return "LocalPeer(%s, %s)" % (self.name, self.collectDir)
+ return "LocalPeer(%s, %s, %s)" % (self.name, self.collectDir, self.ignoreFailureMode)
def __str__(self):
"""
@@ -1842,6 +1847,11 @@
return -1
else:
return 1
+ if self._ignoreFailureMode != other._ignoreFailureMode:
+ if self._ignoreFailureMode < other._ignoreFailureMode:
+ return -1
+ else:
+ return 1
return 0
def _setName(self, value):
@@ -1880,8 +1890,26 @@
"""
return self._collectDir
+ def _setIgnoreFailureMode(self, value):
+ """
+ Property target used to set the ignoreFailure mode.
+ If not C{None}, the mode must be one of the values in L{VALID_FAILURE_MODES}.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is not None:
+ if value not in VALID_FAILURE_MODES:
+ raise ValueError("Ignore failure mode must be one of %s." % VALID_FAILURE_MODES)
+ self._ignoreFailureMode = value
+
+ def _getIgnoreFailureMode(self):
+ """
+ Property target used to get the ignoreFailure mode.
+ """
+ return self._ignoreFailureMode
+
name = property(_getName, _setName, None, "Name of the peer, typically a valid hostname.")
collectDir = property(_getCollectDir, _setCollectDir, None, "Collect directory to stage files from on peer.")
+ ignoreFailureMode = property(_getIgnoreFailureMode, _setIgnoreFailureMode, None, "Ignore failure mode for peer.")
########################################################################
@@ -1908,13 +1936,14 @@
- The rsh command must be a non-empty string.
- The cback command must be a non-empty string.
- Any managed action name must be a non-empty string matching C{ACTION_NAME_REGEX}
+ - The ignore failure mode must be one of the values in L{VALID_FAILURE_MODES}.
@sort: __init__, __repr__, __str__, __cmp__, name, collectDir, remoteUser, rcpCommand
"""
def __init__(self, name=None, collectDir=None, remoteUser=None,
rcpCommand=None, rshCommand=None, cbackCommand=None,
- managed=False, managedActions=None):
+ managed=False, managedActions=None, ignoreFailureMode=None):
"""
Constructor for the C{RemotePeer} class.
@@ -1926,6 +1955,7 @@
@param cbackCommand: Overridden cback-compatible command to use on remote peer.
@param managed: Indicates whether this is a managed peer.
@param managedActions: Overridden set of actions that are managed on the peer.
+ @param ignoreFailureMode: Ignore failure mode for peer.
@raise ValueError: If one of the values is invalid.
"""
@@ -1937,6 +1967,7 @@
self._cbackCommand = None
self._managed = None
self._managedActions = None
+ self._ignoreFailureMode = None
self.name = name
self.collectDir = collectDir
self.remoteUser = remoteUser
@@ -1945,14 +1976,15 @@
self.cbackCommand = cbackCommand
self.managed = managed
self.managedActions = managedActions
+ self.ignoreFailureMode = ignoreFailureMode
def __repr__(self):
"""
Official string representation for class instance.
"""
- return "RemotePeer(%s, %s, %s, %s, %s, %s, %s, %s)" % (self.name, self.collectDir, self.remoteUser,
- self.rcpCommand, self.rshCommand, self.cbackCommand,
- self.managed, self.managedActions)
+ return "RemotePeer(%s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.name, self.collectDir, self.remoteUser,
+ self.rcpCommand, self.rshCommand, self.cbackCommand,
+ self.managed, self.managedActions, self.ignoreFailureMode)
def __str__(self):
"""
@@ -2008,6 +2040,11 @@
return -1
else:
return 1
+ if self._ignoreFailureMode != other._ignoreFailureMode:
+ if self._ignoreFailureMode < other._ignoreFailureMode:
+ return -1
+ else:
+ return 1
return 0
def _setName(self, value):
@@ -2152,6 +2189,23 @@
"""
return self._managedActions
+ def _setIgnoreFailureMode(self, value):
+ """
+ Property target used to set the ignoreFailure mode.
+ If not C{None}, the mode must be one of the values in L{VALID_FAILURE_MODES}.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is not None:
+ if value not in VALID_FAILURE_MODES:
+ raise ValueError("Ignore failure mode must be one of %s." % VALID_FAILURE_MODES)
+ self._ignoreFailureMode = value
+
+ def _getIgnoreFailureMode(self):
+ """
+ Property target used to get the ignoreFailure mode.
+ """
+ return self._ignoreFailureMode
+
name = property(_getName, _setName, None, "Name of the peer, must be a valid hostname.")
collectDir = property(_getCollectDir, _setCollectDir, None, "Collect directory to stage files from on peer.")
remoteUser = property(_getRemoteUser, _setRemoteUser, None, "Name of backup user on remote peer.")
@@ -2160,6 +2214,7 @@
cbackCommand = property(_getCbackCommand, _setCbackCommand, None, "Overridden cback-compatible command to use on remote peer.")
managed = property(_getManaged, _setManaged, None, "Indicates whether this is a managed peer.")
managedActions = property(_getManagedActions, _setManagedActions, None, "Overridden set of actions that are managed on the peer.")
+ ignoreFailureMode = property(_getIgnoreFailureMode, _setIgnoreFailureMode, None, "Ignore failure mode for peer.")
########################################################################
@@ -4846,6 +4901,7 @@
localPeer = LocalPeer()
localPeer.name = readString(entry, "name")
localPeer.collectDir = readString(entry, "collect_dir")
+ localPeer.ignoreFailureMode = readString(entry, "ignore_failures")
localPeers.append(localPeer)
elif peerType == "remote":
remotePeer = RemotePeer()
@@ -4855,6 +4911,7 @@
remotePeer.rcpCommand = readString(entry, "rcp_command")
remotePeer.rshCommand = readString(entry, "rsh_command")
remotePeer.cbackCommand = readString(entry, "cback_command")
+ remotePeer.ignoreFailureMode = readString(entry, "ignore_failures")
remotePeer.managed = readBoolean(entry, "managed")
managedActions = readString(entry, "managed_actions")
remotePeer.managedActions = Config._parseCommaSeparatedString(managedActions)
@@ -5443,8 +5500,9 @@
We add the following fields to the document::
- name peer/name
- collectDir peer/collect_dir
+ name peer/name
+ collectDir peer/collect_dir
+ ignoreFailureMode peer/ignore_failures
Additionally, C{peer/type} is filled in with C{"local"}, since this is a
local peer.
@@ -5464,6 +5522,7 @@
addStringNode(xmlDom, sectionNode, "name", localPeer.name)
addStringNode(xmlDom, sectionNode, "type", "local")
addStringNode(xmlDom, sectionNode, "collect_dir", localPeer.collectDir)
+ addStringNode(xmlDom, sectionNode, "ignore_failures", localPeer.ignoreFailureMode)
_addLocalPeer = staticmethod(_addLocalPeer)
def _addRemotePeer(xmlDom, parentNode, remotePeer):
@@ -5472,15 +5531,16 @@
We add the following fields to the document::
- name peer/name
- collectDir peer/collect_dir
- remoteUser peer/backup_user
- rcpCommand peer/rcp_command
- rcpCommand peer/rcp_command
- rshCommand peer/rsh_command
- cbackCommand peer/cback_command
- managed peer/managed
- managedActions peer/managed_actions
+ name peer/name
+ collectDir peer/collect_dir
+ remoteUser peer/backup_user
+ rcpCommand peer/rcp_command
+ rcpCommand peer/rcp_command
+ rshCommand peer/rsh_command
+ cbackCommand peer/cback_command
+ ignoreFailureMode peer/ignore_failures
+ managed peer/managed
+ managedActions peer/managed_actions
Additionally, C{peer/type} is filled in with C{"remote"}, since this is a
remote peer.
@@ -5504,6 +5564,7 @@
addStringNode(xmlDom, sectionNode, "rcp_command", remotePeer.rcpCommand)
addStringNode(xmlDom, sectionNode, "rsh_command", remotePeer.rshCommand)
addStringNode(xmlDom, sectionNode, "cback_command", remotePeer.cbackCommand)
+ addStringNode(xmlDom, sectionNode, "ignore_failures", remotePeer.ignoreFailureMode)
addBooleanNode(xmlDom, sectionNode, "managed", remotePeer.managed)
managedActions = Config._buildCommaSeparatedString(remotePeer.managedActions)
addStringNode(xmlDom, sectionNode, "managed_actions", managedActions)
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-05-06 15:32:44 UTC (rev 922)
+++ cedar-backup2/trunk/Changelog 2008-10-06 02:11:17 UTC (rev 923)
@@ -2,6 +2,7 @@
* Fix a few typos in the CREDITS file.
* Update README to properly reference SourceForge site.
+ * Add <ignore_failures> option to peer configuration.
Version 2.18.0 05 May 2008
Modified: cedar-backup2/trunk/manual/src/config.xml
===================================================================
--- cedar-backup2/trunk/manual/src/config.xml 2008-05-06 15:32:44 UTC (rev 922)
+++ cedar-backup2/trunk/manual/src/config.xml 2008-10-06 02:11:17 UTC (rev 923)
@@ -775,6 +775,7 @@
<type>remote</type>
<backup_user>backup</backup_user>
<collect_dir>/opt/backup/collect</collect_dir>
+ <ignore_failures>all</ignore_failures>
</peer>
<peer>
<name>machine3</name>
@@ -846,7 +847,6 @@
</listitem>
</varlistentry>
-
<varlistentry>
<term><literal>collect_dir</literal></term>
<listitem>
@@ -864,6 +864,36 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>ignore_failures</literal></term>
+ <listitem>
+ <para>Ignore failure mode for this peer</para>
+ <para>
+ The ignore failure mode indicates whether
+ <quote>not ready to be staged</quote> errors
+ should be ignored for this peer. This option is
+ intended to be used for peers that are up only
+ intermittently, to cut down on the number of
+ error emails received by the Cedar Backup
+ administrator.
+ </para>
+ <para>
+ The "none" mode means that all errors will be
+ reported. This is the default behavior. The
+ "all" mode means to ignore all failures. The
+ "weekly" mode means to ignore failures for a
+ start-of-week or full backup. The "daily" mode
+ means to ignore failures for any backup that is
+ not either a full backup or a start-of-week
+ backup.
+ </para>
+ <para>
+ <emphasis>Restrictions:</emphasis> If set, must
+ be one of "none", "all", "daily", or "weekly".
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</listitem>
@@ -958,6 +988,36 @@
</varlistentry>
<varlistentry>
+ <term><literal>ignore_failures</literal></term>
+ <listitem>
+ <para>Ignore failure mode for this peer</para>
+ <para>
+ The ignore failure mode indicates whether
+ <quote>not ready to be staged</quote> errors
+ should be ignored for this peer. This option is
+ intended to be used for peers that are up only
+ intermittently, to cut down on the number of
+ error emails received by the Cedar Backup
+ administrator.
+ </para>
+ <para>
+ The "none" mode means that all errors will be
+ reported. This is the default behavior. The
+ "all" mode means to ignore all failures. The
+ "weekly" mode means to ignore failures for a
+ start-of-week or full backup. The "daily" mode
+ means to ignore failures for any backup that is
+ not either a full backup or a start-of-week
+ backup.
+ </para>
+ <para>
+ <emphasis>Restrictions:</emphasis> If set, must
+ be one of "none", "all", "daily", or "weekly".
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>backup_user</literal></term>
<listitem>
<para>Name of backup user on the remote peer.</para>
Modified: cedar-backup2/trunk/test/configtests.py
===================================================================
--- cedar-backup2/trunk/test/configtests.py 2008-05-06 15:32:44 UTC (rev 922)
+++ cedar-backup2/trunk/test/configtests.py 2008-10-06 02:11:17 UTC (rev 923)
@@ -3512,14 +3512,16 @@
localPeer = LocalPeer()
self.failUnlessEqual(None, localPeer.name)
self.failUnlessEqual(None, localPeer.collectDir)
+ self.failUnlessEqual(None, localPeer.ignoreFailureMode)
def testConstructor_002(self):
"""
Test constructor with all values filled in, with valid values.
"""
- localPeer = LocalPeer("myname", "/whatever")
+ localPeer = LocalPeer("myname", "/whatever", "all")
self.failUnlessEqual("myname", localPeer.name)
self.failUnlessEqual("/whatever", localPeer.collectDir)
+ self.failUnlessEqual("all", localPeer.ignoreFailureMode)
def testConstructor_003(self):
"""
@@ -3584,7 +3586,39 @@
self.failUnlessAssignRaises(ValueError, localPeer, "collectDir", "bogus")
self.failUnlessEqual(None, localPeer.collectDir)
+ def testConstructor_010(self):
+ """
+ Test assignment of ignoreFailureMode attribute, valid values.
+ """
+ localPeer = LocalPeer()
+ self.failUnlessEqual(None, localPeer.ignoreFailureMode)
+ localPeer.ignoreFailureMode = "none"
+ self.failUnlessEqual("none", localPeer.ignoreFailureMode)
+ localPeer.ignoreFailureMode = "all"
+ self.failUnlessEqual("all", localPeer.ignoreFailureMode)
+ localPeer.ignoreFailureMode = "daily"
+ self.failUnlessEqual("daily", localPeer.ignoreFailureMode)
+ localPeer.ignoreFailureMode = "weekly"
+ self.failUnlessEqual("weekly", localPeer.ignoreFailureMode)
+ def testConstructor_011(self):
+ """
+ Test assignment of ignoreFailureMode attribute, invalid value.
+ """
+ localPeer = LocalPeer()
+ self.failUnlessEqual(None, localPeer.ignoreFailureMode)
+ self.failUnlessAssignRaises(ValueError, localPeer, "ignoreFailureMode", "bogus")
+
+ def testConstructor_012(self):
+ """
+ Test assignment of ignoreFailureMode attribute, None value.
+ """
+ localPeer = LocalPeer()
+ self.failUnlessEqual(None, localPeer.ignoreFailureMode)
+ localPeer.ignoreFailureMode = None;
+ self.failUnlessEqual(None, localPeer.ignoreFailureMode)
+
+
############################
# Test comparison operators
############################
@@ -3607,8 +3641,8 @@
"""
Test comparison of two identical objects, all attributes non-None.
"""
- localPeer1 = LocalPeer("myname", "/etc/stuff")
- localPeer2 = LocalPeer("myname", "/etc/stuff")
+ localPeer1 = LocalPeer("myname", "/etc/stuff", "all")
+ localPeer2 = LocalPeer("myname", "/etc/stuff", "all")
self.failUnless(localPeer1 == localPeer2)
self.failUnless(not localPeer1 < localPeer2)
self.failUnless(localPeer1 <= localPeer2)
@@ -3634,8 +3668,8 @@
"""
Test comparison of two differing objects, name differs.
"""
- localPeer1 = LocalPeer("name", "/etc/stuff")
- localPeer2 = LocalPeer("name", "/etc/whatever")
+ localPeer1 = LocalPeer("name", "/etc/stuff", "all")
+ localPeer2 = LocalPeer("name", "/etc/whatever", "all")
self.failIfEqual(localPeer1, localPeer2)
self.failUnless(not localPeer1 == localPeer2)
self.failUnless(localPeer1 < localPeer2)
@@ -3662,8 +3696,8 @@
"""
Test comparison of two differing objects, collectDir differs.
"""
- localPeer1 = LocalPeer("name2", "/etc/stuff")
- localPeer2 = LocalPeer("name1", "/etc/stuff")
+ localPeer1 = LocalPeer("name2", "/etc/stuff", "all")
+ localPeer2 = LocalPeer("name1", "/etc/stuff", "all")
self.failIfEqual(localPeer1, localPeer2)
self.failUnless(not localPeer1 == localPeer2)
self.failUnless(not localPeer1 < localPeer2)
@@ -3672,7 +3706,35 @@
self.failUnless(localPeer1 >= localPeer2)
self.failUnless(localPeer1 != localPeer2)
+ def testComparison_008(self):
+ """
+ Test comparison of two differing objects, ignoreFailureMode differs (one None).
+ """
+ localPeer1 = LocalPeer()
+ localPeer2 = LocalPeer(ignoreFailureMode="all")
+ self.failIfEqual(localPeer1, localPeer2)
+ self.failUnless(not localPeer1 == localPeer2)
+ self.failUnless(localPeer1 < localPeer2)
+ self.failUnless(localPeer1 <= localPeer2)
+ self.failUnless(not localPeer1 > localPeer2)
+ self.failUnless(not localPeer1 >= localPeer2)
+ self.failUnless(localPeer1 != localPeer2)
+ def testComparison_009(self):
+ """
+ Test comparison of two differing objects, collectDir differs.
+ """
+ localPeer1 = LocalPeer("name1", "/etc/stuff", "none")
+ localPeer2 = LocalPeer("name1", "/etc/stuff", "all")
+ self.failIfEqual(localPeer1, localPeer2)
+ self.failUnless(not localPeer1 == localPeer2)
+ self.failUnless(not localPeer1 < localPeer2)
+ self.failUnless(not localPeer1 <= localPeer2)
+ self.failUnless(localPeer1 > localPeer2)
+ self.failUnless(localPeer1 >= localPeer2)
+ self.failUnless(localPeer1 != localPeer2)
+
+
#######################
# TestRemotePeer class
#######################
@@ -3720,12 +3782,13 @@
self.failUnlessEqual(None, remotePeer.cbackCommand)
self.failUnlessEqual(False, remotePeer.managed)
self.failUnlessEqual(None, remotePeer.managedActions)
+ self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
def testConstructor_002(self):
"""
Test constructor with all values filled in, with valid values.
"""
- remotePeer = RemotePeer("myname", "/stuff", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
+ remotePeer = RemotePeer("myname", "/stuff", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
self.failUnlessEqual("myname", remotePeer.name)
self.failUnlessEqual("/stuff", remotePeer.collectDir)
self.failUnlessEqual("backup", remotePeer.remoteUser)
@@ -3734,6 +3797,7 @@
self.failUnlessEqual("cback", remotePeer.cbackCommand)
self.failUnlessEqual(True, remotePeer.managed)
self.failUnlessEqual(["collect", ], remotePeer.managedActions)
+ self.failUnlessEqual("all", remotePeer.ignoreFailureMode)
def testConstructor_003(self):
"""
@@ -3977,7 +4041,39 @@
self.failUnlessEqual(None, remotePeer.managedActions)
self.failUnlessAssignRaises(ValueError, remotePeer, "managedActions", ["ken", "dash-word", ])
+ def testConstructor_029(self):
+ """
+ Test assignment of ignoreFailureMode attribute, valid values.
+ """
+ remotePeer = RemotePeer()
+ self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
+ remotePeer.ignoreFailureMode = "none"
+ self.failUnlessEqual("none", remotePeer.ignoreFailureMode)
+ remotePeer.ignoreFailureMode = "all"
+ self.failUnlessEqual("all", remotePeer.ignoreFailureMode)
+ remotePeer.ignoreFailureMode = "daily"
+ self.failUnlessEqual("daily", remotePeer.ignoreFailureMode)
+ remotePeer.ignoreFailureMode = "weekly"
+ self.failUnlessEqual("weekly", remotePeer.ignoreFailureMode)
+ def testConstructor_030(self):
+ """
+ Test assignment of ignoreFailureMode attribute, invalid value.
+ """
+ remotePeer = RemotePeer()
+ self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
+ self.failUnlessAssignRaises(ValueError, remotePeer, "ignoreFailureMode", "bogus")
+
+ def testConstructor_031(self):
+ """
+ Test assignment of ignoreFailureMode attribute, None value.
+ """
+ remotePeer = RemotePeer()
+ self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
+ remotePeer.ignoreFailureMode = None;
+ self.failUnlessEqual(None, remotePeer.ignoreFailureMode)
+
+
############################
# Test comparison operators
############################
@@ -4000,8 +4096,8 @@
"""
Test comparison of two identical objects, all attributes non-None.
"""
- remotePeer1 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
- remotePeer2 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
+ remotePeer1 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
+ remotePeer2 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
self.failUnless(remotePeer1 == remotePeer2)
self.failUnless(not remotePeer1 < remotePeer2)
self.failUnless(remotePeer1 <= remotePeer2)
@@ -4027,8 +4123,8 @@
"""
Test comparison of two differing objects, name differs.
"""
- remotePeer1 = RemotePeer("name1", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
- remotePeer2 = RemotePeer("name2", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
+ remotePeer1 = RemotePeer("name1", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
+ remotePeer2 = RemotePeer("name2", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
self.failIfEqual(remotePeer1, remotePeer2)
self.failUnless(not remotePeer1 == remotePeer2)
self.failUnless(remotePeer1 < remotePeer2)
@@ -4055,8 +4151,8 @@
"""
Test comparison of two differing objects, collectDir differs.
"""
- remotePeer1 = RemotePeer("name", "/etc", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
- remotePeer2 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
+ remotePeer1 = RemotePeer("name", "/etc", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
+ remotePeer2 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
self.failIfEqual(remotePeer1, remotePeer2)
self.failUnless(not remotePeer1 == remotePeer2)
self.failUnless(remotePeer1 < remotePeer2)
@@ -4083,8 +4179,8 @@
"""
Test comparison of two differing objects, remoteUser differs.
"""
- remotePeer1 = RemotePeer("name", "/etc/stuff/tmp/X11", "spot", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
- remotePeer2 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ])
+ remotePeer1 = RemotePeer("name", "/etc/stuff/tmp/X11", "spot", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
+ remotePeer2 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -1 -B", "ssh", "cback", True, [ "collect", ], "all")
self.failIfEqual(remotePeer1, remotePeer2)
self.failUnless(not remotePeer1 == remotePeer2)
self.failUnless(not remotePeer1 < remotePeer2)
@@ -4111,8 +4207,8 @@
"""
Test comparison of two differing objects, rcpCommand differs.
"""
- remotePeer1 = RemotePeer("name", "/etc/stuff/tmp/X11", "backup", "scp -2 -B", "ssh", "cbac...
[truncated message content] |
|
From: <pro...@us...> - 2008-10-06 02:29:57
|
Revision: 924
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=924&view=rev
Author: pronovic
Date: 2008-10-06 02:29:46 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Add <ignore_failures> option to peer configuration.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/test/peertests.py
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-10-06 02:11:17 UTC (rev 923)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-10-06 02:29:46 UTC (rev 924)
@@ -253,7 +253,7 @@
configPeers = config.peers.localPeers
if configPeers is not None:
for peer in configPeers:
- localPeer = LocalPeer(peer.name, peer.collectDir)
+ localPeer = LocalPeer(peer.name, peer.collectDir, peer.ignoreFailureMode)
localPeers.append(localPeer)
logger.debug("Found local peer: [%s]" % localPeer.name)
return localPeers
@@ -283,7 +283,7 @@
localUser = _getLocalUser(config)
rcpCommand = _getRcpCommand(config, peer)
remotePeer = RemotePeer(peer.name, peer.collectDir, config.options.workingDir,
- remoteUser, rcpCommand, localUser)
+ remoteUser, rcpCommand, localUser, peer.ignoreFailureMode)
remotePeers.append(remotePeer)
logger.debug("Found remote peer: [%s]" % remotePeer.name)
return remotePeers
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2008-10-06 02:11:17 UTC (rev 923)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2008-10-06 02:29:46 UTC (rev 924)
@@ -63,6 +63,7 @@
from CedarBackup2.filesystem import FilesystemList
from CedarBackup2.util import resolveCommand, executeCommand
from CedarBackup2.util import splitCommandLine, encodePath
+from CedarBackup2.config import VALID_FAILURE_MODES
########################################################################
@@ -110,7 +111,7 @@
# Constructor
##############
- def __init__(self, name, collectDir):
+ def __init__(self, name, collectDir, ignoreFailureMode=None):
"""
Initializes a local backup peer.
@@ -125,13 +126,18 @@
@param collectDir: Path to the peer's collect directory
@type collectDir: String representing an absolute local path on disk
+ @param ignoreFailureMode: Ignore failure mode for this peer
+ @type ignoreFailureMode: One of VALID_FAILURE_MODES
+
@raise ValueError: If the name is empty.
@raise ValueError: If collect directory is not an absolute path.
"""
self._name = None
self._collectDir = None
+ self._ignoreFailureMode = None
self.name = name
self.collectDir = collectDir
+ self.ignoreFailureMode = ignoreFailureMode
#############
@@ -172,8 +178,26 @@
"""
return self._collectDir
+ def _setIgnoreFailureMode(self, value):
+ """
+ Property target used to set the ignoreFailure mode.
+ If not C{None}, the mode must be one of the values in L{VALID_FAILURE_MODES}.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is not None:
+ if value not in VALID_FAILURE_MODES:
+ raise ValueError("Ignore failure mode must be one of %s." % VALID_FAILURE_MODES)
+ self._ignoreFailureMode = value
+
+ def _getIgnoreFailureMode(self):
+ """
+ Property target used to get the ignoreFailure mode.
+ """
+ return self._ignoreFailureMode
+
name = property(_getName, _setName, None, "Name of the peer.")
collectDir = property(_getCollectDir, _setCollectDir, None, "Path to the peer's collect directory (an absolute local path).")
+ ignoreFailureMode = property(_getIgnoreFailureMode, _setIgnoreFailureMode, None, "Ignore failure mode for peer.")
#################
@@ -437,7 +461,8 @@
##############
def __init__(self, name=None, collectDir=None, workingDir=None, remoteUser=None,
- rcpCommand=None, localUser=None, rshCommand=None, cbackCommand=None):
+ rcpCommand=None, localUser=None, rshCommand=None, cbackCommand=None,
+ ignoreFailureMode=None):
"""
Initializes a remote backup peer.
@@ -471,6 +496,9 @@
@param cbackCommand: A chack-compatible command to use for executing managed actions
@type cbackCommand: String representing a system command including required arguments
+ @param ignoreFailureMode: Ignore failure mode for this peer
+ @type ignoreFailureMode: One of VALID_FAILURE_MODES
+
@raise ValueError: If collect directory is not an absolute path
"""
self._name = None
@@ -483,6 +511,7 @@
self._rshCommand = None
self._rshCommandList = None
self._cbackCommand = None
+ self._ignoreFailureMode = None
self.name = name
self.collectDir = collectDir
self.workingDir = workingDir
@@ -491,6 +520,7 @@
self.rcpCommand = rcpCommand
self.rshCommand = rshCommand
self.cbackCommand = cbackCommand
+ self.ignoreFailureMode = ignoreFailureMode
#############
@@ -671,6 +701,23 @@
"""
return self._cbackCommand
+ def _setIgnoreFailureMode(self, value):
+ """
+ Property target used to set the ignoreFailure mode.
+ If not C{None}, the mode must be one of the values in L{VALID_FAILURE_MODES}.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is not None:
+ if value not in VALID_FAILURE_MODES:
+ raise ValueError("Ignore failure mode must be one of %s." % VALID_FAILURE_MODES)
+ self._ignoreFailureMode = value
+
+ def _getIgnoreFailureMode(self):
+ """
+ Property target used to get the ignoreFailure mode.
+ """
+ return self._ignoreFailureMode
+
name = property(_getName, _setName, None, "Name of the peer (a valid DNS hostname).")
collectDir = property(_getCollectDir, _setCollectDir, None, "Path to the peer's collect directory (an absolute local path).")
workingDir = property(_getWorkingDir, _setWorkingDir, None, "Path to the peer's working directory (an absolute local path).")
@@ -679,6 +726,7 @@
rcpCommand = property(_getRcpCommand, _setRcpCommand, None, "An rcp-compatible copy command to use for copying files.")
rshCommand = property(_getRshCommand, _setRshCommand, None, "An rsh-compatible command to use for remote shells to the peer.")
cbackCommand = property(_getCbackCommand, _setCbackCommand, None, "A chack-compatible command to use for executing managed actions.")
+ ignoreFailureMode = property(_getIgnoreFailureMode, _setIgnoreFailureMode, None, "Ignore failure mode for peer.")
#################
Modified: cedar-backup2/trunk/test/peertests.py
===================================================================
--- cedar-backup2/trunk/test/peertests.py 2008-10-06 02:11:17 UTC (rev 923)
+++ cedar-backup2/trunk/test/peertests.py 2008-10-06 02:29:46 UTC (rev 924)
@@ -99,7 +99,7 @@
import tarfile
import getpass
from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar
-from CedarBackup2.testutil import getMaskAsMode, getLogin, runningAsRoot
+from CedarBackup2.testutil import getMaskAsMode, getLogin, runningAsRoot, failUnlessAssignRaises
from CedarBackup2.testutil import platformSupportsPermissions, platformWindows
from CedarBackup2.peer import LocalPeer, RemotePeer
from CedarBackup2.peer import DEF_RCP_COMMAND, DEF_RSH_COMMAND
@@ -178,7 +178,11 @@
"""Calls buildPath on components and then returns file mode for the file."""
return stat.S_IMODE(os.stat(self.buildPath(components)).st_mode)
+ def failUnlessAssignRaises(self, exception, object, property, value):
+ """Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
+ failUnlessAssignRaises(self, exception, object, property, value)
+
###########################
# Test basic functionality
###########################
@@ -197,9 +201,11 @@
"""
name = "peer1"
collectDir = "/absolute/path/name"
- peer = LocalPeer(name, collectDir)
+ ignoreFailureMode = "all"
+ peer = LocalPeer(name, collectDir, ignoreFailureMode)
self.failUnlessEqual(name, peer.name)
self.failUnlessEqual(collectDir, peer.collectDir)
+ self.failUnlessEqual(ignoreFailureMode, peer.ignoreFailureMode)
def testBasic_003(self):
"""
@@ -212,7 +218,24 @@
self.failUnlessEqual(name, peer.name)
self.failUnlessEqual(collectDir, peer.collectDir)
+ def testBasic_004(self):
+ """
+ Make sure assignment works for all valid failure modes.
+ """
+ name = "peer1"
+ collectDir = "/absolute/path/name"
+ ignoreFailureMode = "all"
+ peer = LocalPeer(name, collectDir, ignoreFailureMode)
+ self.failUnlessEqual("all", peer.ignoreFailureMode)
+ peer.ignoreFailureMode = "none"
+ self.failUnlessEqual("none", peer.ignoreFailureMode)
+ peer.ignoreFailureMode = "daily"
+ self.failUnlessEqual("daily", peer.ignoreFailureMode)
+ peer.ignoreFailureMode = "weekly"
+ self.failUnlessEqual("weekly", peer.ignoreFailureMode)
+ self.failUnlessAssignRaises(ValueError, peer, "ignoreFailureMode", "bogus")
+
###############################
# Test checkCollectIndicator()
###############################
@@ -694,7 +717,11 @@
"""Calls buildPath on components and then returns file mode for the file."""
return stat.S_IMODE(os.stat(self.buildPath(components)).st_mode)
+ def failUnlessAssignRaises(self, exception, object, property, value):
+ """Equivalent of L{failUnlessRaises}, but used for property assignments instead."""
+ failUnlessAssignRaises(self, exception, object, property, value)
+
############################
# Tests basic functionality
############################
@@ -734,6 +761,7 @@
self.failUnlessEqual(None, peer.cbackCommand)
self.failUnlessEqual(DEF_RCP_COMMAND, peer._rcpCommandList)
self.failUnlessEqual(DEF_RSH_COMMAND, peer._rshCommandList)
+ self.failUnlessEqual(None, peer.ignoreFailureMode)
def testBasic_003(self):
"""
@@ -833,7 +861,21 @@
self.failUnlessEqual(None, peer.rshCommand)
self.failUnlessEqual(cbackCommand, peer.cbackCommand)
+ def testBasic_008(self):
+ """
+ Make sure assignment works for all valid failure modes.
+ """
+ peer = RemotePeer(name="name", remoteUser="user", ignoreFailureMode="all")
+ self.failUnlessEqual("all", peer.ignoreFailureMode)
+ peer.ignoreFailureMode = "none"
+ self.failUnlessEqual("none", peer.ignoreFailureMode)
+ peer.ignoreFailureMode = "daily"
+ self.failUnlessEqual("daily", peer.ignoreFailureMode)
+ peer.ignoreFailureMode = "weekly"
+ self.failUnlessEqual("weekly", peer.ignoreFailureMode)
+ self.failUnlessAssignRaises(ValueError, peer, "ignoreFailureMode", "bogus")
+
###############################
# Test checkCollectIndicator()
###############################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-10-06 02:39:41
|
Revision: 926
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=926&view=rev
Author: pronovic
Date: 2008-10-06 02:39:19 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Releasing 2.19.0
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2008-10-06 02:38:13 UTC (rev 925)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2008-10-06 02:39:19 UTC (rev 926)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2008"
-VERSION = "2.18.0"
-DATE = "05 May 2008"
+VERSION = "2.19.0"
+DATE = "05 Oct 2008"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-10-06 02:38:13 UTC (rev 925)
+++ cedar-backup2/trunk/Changelog 2008-10-06 02:39:19 UTC (rev 926)
@@ -1,4 +1,4 @@
-Version 2.18.1 unreleased
+Version 2.19.0 05 Oct 2008
* Fix a few typos in the CREDITS file.
* Update README to properly reference SourceForge site.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-11-15 18:12:53
|
Revision: 928
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=928&view=rev
Author: pronovic
Date: 2008-11-15 18:12:43 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Fix bug when logging strange filenames.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2008-10-06 02:39:43 UTC (rev 927)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2008-11-15 18:12:43 UTC (rev 928)
@@ -304,10 +304,12 @@
logger.debug("Path [%s] is excluded based on excludePaths." % path)
return 0
for pattern in self.excludePatterns:
+ pattern = encodePath(pattern) # use same encoding as filenames
if re.compile(r"^%s$" % pattern).match(path): # safe to assume all are valid due to RegexList
logger.debug("Path [%s] is excluded based on pattern [%s]." % (path, pattern))
return 0
for pattern in self.excludeBasenamePatterns: # safe to assume all are valid due to RegexList
+ pattern = encodePath(pattern) # use same encoding as filenames
if re.compile(r"^%s$" % pattern).match(os.path.basename(path)):
logger.debug("Path [%s] is excluded based on basename pattern [%s]." % (path, pattern))
return 0
@@ -347,10 +349,12 @@
logger.debug("Path [%s] is excluded based on excludePaths." % path)
return 0
for pattern in self.excludePatterns: # safe to assume all are valid due to RegexList
+ pattern = encodePath(pattern) # use same encoding as filenames
if re.compile(r"^%s$" % pattern).match(path):
logger.debug("Path [%s] is excluded based on pattern [%s]." % (path, pattern))
return 0
for pattern in self.excludeBasenamePatterns: # safe to assume all are valid due to RegexList
+ pattern = encodePath(pattern) # use same encoding as filenames
if re.compile(r"^%s$" % pattern).match(os.path.basename(path)):
logger.debug("Path [%s] is excluded based on basename pattern [%s]." % (path, pattern))
return 0
@@ -460,10 +464,12 @@
logger.debug("Path [%s] is excluded based on excludePaths." % path)
return added
for pattern in self.excludePatterns: # safe to assume all are valid due to RegexList
+ pattern = encodePath(pattern) # use same encoding as filenames
if re.compile(r"^%s$" % pattern).match(path):
logger.debug("Path [%s] is excluded based on pattern [%s]." % (path, pattern))
return added
for pattern in self.excludeBasenamePatterns: # safe to assume all are valid due to RegexList
+ pattern = encodePath(pattern) # use same encoding as filenames
if re.compile(r"^%s$" % pattern).match(os.path.basename(path)):
logger.debug("Path [%s] is excluded based on basename pattern [%s]." % (path, pattern))
return added
@@ -537,6 +543,7 @@
removed += 1
else:
try:
+ pattern = encodePath(pattern) # use same encoding as filenames
compiled = re.compile(pattern)
except re.error:
raise ValueError("Pattern is not a valid regular expression.")
@@ -579,6 +586,7 @@
removed += 1
else:
try:
+ pattern = encodePath(pattern) # use same encoding as filenames
compiled = re.compile(pattern)
except re.error:
raise ValueError("Pattern is not a valid regular expression.")
@@ -619,6 +627,7 @@
removed += 1
else:
try:
+ pattern = encodePath(pattern) # use same encoding as filenames
compiled = re.compile(pattern)
except re.error:
raise ValueError("Pattern is not a valid regular expression.")
@@ -653,6 +662,7 @@
@raise ValueError: If the passed-in pattern is not a valid regular expression.
"""
try:
+ pattern = encodePath(pattern) # use same encoding as filenames
compiled = re.compile(pattern)
except re.error:
raise ValueError("Pattern is not a valid regular expression.")
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-10-06 02:39:43 UTC (rev 927)
+++ cedar-backup2/trunk/Changelog 2008-11-15 18:12:43 UTC (rev 928)
@@ -1,3 +1,7 @@
+Version 2.19.1 unreleased
+
+ * Fix bug when logging strange filenames.
+
Version 2.19.0 05 Oct 2008
* Fix a few typos in the CREDITS file.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-11-15 18:16:11
|
Revision: 929
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=929&view=rev
Author: pronovic
Date: 2008-11-15 18:16:08 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Release 2.19.1
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2008-11-15 18:12:43 UTC (rev 928)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2008-11-15 18:16:08 UTC (rev 929)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2008"
-VERSION = "2.19.0"
-DATE = "05 Oct 2008"
+VERSION = "2.19.1"
+DATE = "15 Nov 2008"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-11-15 18:12:43 UTC (rev 928)
+++ cedar-backup2/trunk/Changelog 2008-11-15 18:16:08 UTC (rev 929)
@@ -1,4 +1,4 @@
-Version 2.19.1 unreleased
+Version 2.19.1 15 Nov 2008
* Fix bug when logging strange filenames.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-12-09 02:07:13
|
Revision: 933
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=933&view=rev
Author: pronovic
Date: 2008-12-09 02:07:06 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
Release 2.19.2
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2008-12-09 02:03:44 UTC (rev 932)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2008-12-09 02:07:06 UTC (rev 933)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2008"
-VERSION = "2.19.1"
-DATE = "15 Nov 2008"
+VERSION = "2.19.2"
+DATE = "08 Dec 2008"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-12-09 02:03:44 UTC (rev 932)
+++ cedar-backup2/trunk/Changelog 2008-12-09 02:07:06 UTC (rev 933)
@@ -1,4 +1,4 @@
-Version 2.19.2 unreleased
+Version 2.19.2 08 Dec 2008
* Fix cback-span problem when writing store indicators.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-12-09 02:22:02
|
Revision: 931
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=931&view=rev
Author: pronovic
Date: 2008-12-09 01:39:47 +0000 (Tue, 09 Dec 2008)
Log Message:
-----------
Change span to use its own function to write store indicator files
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/tools/span.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/tools/span.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/span.py 2008-11-15 18:16:57 UTC (rev 930)
+++ cedar-backup2/trunk/CedarBackup2/tools/span.py 2008-12-09 01:39:47 UTC (rev 931)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007-2008 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -71,7 +71,7 @@
from CedarBackup2.cli import DEFAULT_CONFIG, DEFAULT_LOGFILE, DEFAULT_OWNERSHIP, DEFAULT_MODE
from CedarBackup2.actions.constants import STORE_INDICATOR
from CedarBackup2.actions.util import createWriter
-from CedarBackup2.actions.store import consistencyCheck, writeStoreIndicator
+from CedarBackup2.actions.store import consistencyCheck, writeIndicatorFile
from CedarBackup2.actions.util import findDailyDirs
from CedarBackup2.knapsack import firstFit, bestFit, worstFit, alternateFit
@@ -413,7 +413,7 @@
_getReturn("Please replace the disc in your backup device.\nPress return when ready.")
print "==="
- writeStoreIndicator(config, dailyDirs)
+ _writeStoreIndicator(config, dailyDirs)
print ""
print "Completed writing all discs."
@@ -448,6 +448,23 @@
return (results, fileList)
+##################################
+# _writeStoreIndicator() function
+##################################
+
+def _writeStoreIndicator(config, dailyDirs):
+ """
+ Writes a store indicator file into daily directories.
+
+ @param config: Config object.
+ @param dailyDirs: List of daily directories
+ """
+ for dailyDir in dailyDirs:
+ writeIndicatorFile(dailyDir, STORE_INDICATOR,
+ config.options.backupUser,
+ config.options.backupGroup)
+
+
########################
# _getWriter() function
########################
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-11-15 18:16:57 UTC (rev 930)
+++ cedar-backup2/trunk/Changelog 2008-12-09 01:39:47 UTC (rev 931)
@@ -1,3 +1,7 @@
+Version 2.19.2 unreleased
+
+ *
+
Version 2.19.1 15 Nov 2008
* Fix bug when logging strange filenames.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-03-29 18:56:54
|
Revision: 935
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=935&view=rev
Author: pronovic
Date: 2009-03-29 18:56:50 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Fix minor epydoc typos, mostly in @sort directives.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/extend/subversion.py
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2009-03-29 18:56:50 UTC (rev 935)
@@ -300,8 +300,6 @@
type (_ActionItem before _ManagedActionItem) and then by index within type.
@cvar SORT_ORDER: Defines a sort order to order properly between types.
-
- @sort: __init__, index, module, function
"""
SORT_ORDER = 0
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2009-03-29 18:56:50 UTC (rev 935)
@@ -430,7 +430,7 @@
- Any action name must be a non-empty string matching C{ACTION_NAME_REGEX}
- @sort: __init__, __repr__, __str__, __cmp__, action, command, before, after
+ @sort: __init__, __repr__, __str__, __cmp__, beforeList, afterList
"""
def __init__(self, beforeList=None, afterList=None):
Modified: cedar-backup2/trunk/CedarBackup2/extend/subversion.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/CedarBackup2/extend/subversion.py 2009-03-29 18:56:50 UTC (rev 935)
@@ -124,7 +124,7 @@
Relative exclusions are allowed here. However, there is no configured
ignore file, because repository dir backups are not recursive.
- @sort: __init__, __repr__, __str__, __cmp__, directoryPat, collectMode, compressMode
+ @sort: __init__, __repr__, __str__, __cmp__, directoryPath, collectMode, compressMode
"""
def __init__(self, repositoryType=None, directoryPath=None, collectMode=None, compressMode=None,
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-03-29 18:56:50 UTC (rev 935)
@@ -115,7 +115,7 @@
because the operating system never reports a file as a soft link.
@sort: __init__, addFile, addDir, addDirContents, removeFiles, removeDirs,
- removeLinks, removeMatch, removeInvalid, normalize, validate,
+ removeLinks, removeMatch, removeInvalid, normalize,
excludeFiles, excludeDirs, excludeLinks, excludePaths,
excludePatterns, excludeBasenamePatterns, ignoreFile
"""
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2009-03-29 18:56:50 UTC (rev 935)
@@ -39,7 +39,7 @@
"""
Provides backup peer-related objects and utility functions.
-@sort: LocalPeer, Remote Peer
+@sort: LocalPeer, RemotePeer
@var DEF_COLLECT_INDICATOR: Name of the default collect indicator file.
@var DEF_STAGE_INDICATOR: Name of the default stage indicator file.
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2009-03-29 18:56:50 UTC (rev 935)
@@ -42,7 +42,7 @@
"""
Provides general-purpose utilities.
-@sort: AbsolutePathList, ObjectTypeList, RestrictedValueList, RegexMatchList,
+@sort: AbsolutePathList, ObjectTypeList, RestrictedContentList, RegexMatchList,
RegexList, _Vertex, DirectedGraph, PathResolverSingleton,
sortDict, convertSize, getUidGid, changeOwnership, splitCommandLine,
resolveCommand, executeCommand, calculateFileAge, encodePath, nullDevice,
@@ -955,7 +955,7 @@
Diagnostic information is information that is useful to get from users for
debugging purposes. I'm consolidating it all here into one object.
- @sort: __init__, __repr__, __str__, __cmp__
+ @sort: __init__, __repr__, __str__
"""
def __init__(self):
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-03-29 18:55:58 UTC (rev 934)
+++ cedar-backup2/trunk/Changelog 2009-03-29 18:56:50 UTC (rev 935)
@@ -1,3 +1,7 @@
+Version 2.19.3 unreleased
+
+ * Fix minor epydoc typos, mostly in @sort directives.
+
Version 2.19.2 08 Dec 2008
* Fix cback-span problem when writing store indicators.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-03-29 19:35:04
|
Revision: 936
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=936&view=rev
Author: pronovic
Date: 2009-03-29 19:35:00 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Remove support for user manual PDF format
Modified Paths:
--------------
cedar-backup2/trunk/CREDITS
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/MANIFEST.in
cedar-backup2/trunk/manual/Makefile
Added Paths:
-----------
cedar-backup2/trunk/doc/pdf/
cedar-backup2/trunk/doc/pdf/Makefile
cedar-backup2/trunk/doc/pdf/README.txt
cedar-backup2/trunk/doc/pdf/fo-stylesheet.xsl
cedar-backup2/trunk/doc/pdf/images/
cedar-backup2/trunk/doc/pdf/run-fop.sh
Removed Paths:
-------------
cedar-backup2/trunk/manual/src/images/pdf/
cedar-backup2/trunk/util/docbook/fo-stylesheet.xsl
cedar-backup2/trunk/util/docbook/run-fop.sh
Modified: cedar-backup2/trunk/CREDITS
===================================================================
--- cedar-backup2/trunk/CREDITS 2009-03-29 18:56:50 UTC (rev 935)
+++ cedar-backup2/trunk/CREDITS 2009-03-29 19:35:00 UTC (rev 936)
@@ -23,7 +23,7 @@
software, as indicated in the source code itself.
Unless otherwise indicated, all Cedar Backup source code is Copyright
-(c) 2004-2008 Kenneth J. Pronovici and is released under the GNU General
+(c) 2004-2009 Kenneth J. Pronovici and is released under the GNU General
Public License. The contents of the GNU General Public License can be
found in the LICENSE file, or can be downloaded from http://www.gnu.org/.
@@ -52,11 +52,11 @@
the Subversion source tree and did not specify an explicit copyright
notice.
-Some of the PDF-specific graphics in the user manual were either directly
-taken from or were derived from images distributed in Norman Walsh's
-Docbook XSL distribution. These graphics are (c) 1999, 2000, 2001 Norman
-Walsh and were originally released under a BSD-style license as documented
-below.
+Some of the PDF-specific graphics in the user manual (now obsolete and
+orphaned off in the doc/pdf directory) were either directly taken from or
+were derived from images distributed in Norman Walsh's Docbook XSL
+distribution. These graphics are (c) 1999, 2000, 2001 Norman Walsh and
+were originally released under a BSD-style license as documented below.
Source code annotated as "(c) 2000 Fourthought Inc, USA" was taken from or
derived from code within the PyXML distribution and was originally part of
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-03-29 18:56:50 UTC (rev 935)
+++ cedar-backup2/trunk/Changelog 2009-03-29 19:35:00 UTC (rev 936)
@@ -1,6 +1,7 @@
Version 2.19.3 unreleased
* Fix minor epydoc typos, mostly in @sort directives.
+ * Removed support for user manual PDF format (see doc/pdf).
Version 2.19.2 08 Dec 2008
Modified: cedar-backup2/trunk/MANIFEST.in
===================================================================
--- cedar-backup2/trunk/MANIFEST.in 2009-03-29 18:56:50 UTC (rev 935)
+++ cedar-backup2/trunk/MANIFEST.in 2009-03-29 19:35:00 UTC (rev 936)
@@ -19,7 +19,6 @@
include manual/Makefile
include manual/src/*.xml
include manual/src/images/html/*.png
-include manual/src/images/pdf/*.png
include doc/cback.1
include doc/cback-span.1
include doc/cback.conf.sample
Added: cedar-backup2/trunk/doc/pdf/Makefile
===================================================================
--- cedar-backup2/trunk/doc/pdf/Makefile (rev 0)
+++ cedar-backup2/trunk/doc/pdf/Makefile 2009-03-29 19:35:00 UTC (rev 936)
@@ -0,0 +1,167 @@
+# vim: set ft=make:
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Language : Make
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Makefile used for building the Cedar Backup manual.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+########
+# Notes
+########
+
+# This Makefile was originally taken from the Subversion project's book
+# (http://svnbook.red-bean.com/) and has been substantially modifed (almost
+# completely rewritten) for use with Cedar Backup.
+#
+# The original Makefile was (c) 2000-2004 CollabNet (see CREDITS).
+#
+# Note that by default, we only build HTML, HTML chunk and PDF output,
+# not Postscript.
+
+
+########################
+# Programs and commands
+########################
+
+CP = cp
+FOP = ../util/docbook/run-fop.sh
+INSTALL = install
+MKDIR = mkdir
+RM = rm
+XSLTPROC = xsltproc
+W3M = w3m
+
+
+############
+# Locations
+############
+
+INSTALL_DIR = ../doc/manual
+
+XSL_DIR = ../util/docbook
+STYLES_CSS = $(XSL_DIR)/styles.css
+XSL_FO = $(XSL_DIR)/fo-stylesheet.xsl
+XSL_HTML = $(XSL_DIR)/html-stylesheet.xsl
+XSL_CHUNK = $(XSL_DIR)/chunk-stylesheet.xsl
+
+MANUAL_TOP = .
+MANUAL_DIR = $(MANUAL_TOP)/src
+MANUAL_CHUNK_DIR = $(MANUAL_DIR)/chunk
+MANUAL_HTML_TARGET = $(MANUAL_DIR)/manual.html
+MANUAL_CHUNK_TARGET = $(MANUAL_CHUNK_DIR)/index.html # index.html is created last
+MANUAL_PDF_TARGET = $(MANUAL_DIR)/manual.pdf
+MANUAL_PS_TARGET = $(MANUAL_DIR)/manual.ps
+MANUAL_FO_TARGET = $(MANUAL_DIR)/manual.fo
+MANUAL_TEXT_TARGET = $(MANUAL_DIR)/manual.txt
+MANUAL_XML_SOURCE = $(MANUAL_DIR)/book.xml
+MANUAL_ALL_SOURCE = $(MANUAL_DIR)/*.xml
+MANUAL_HTML_IMAGES = $(MANUAL_DIR)/images/html/*.png
+MANUAL_PDF_IMAGES = $(MANUAL_DIR)/images/pdf/*.png
+
+
+#############################################
+# High-level targets and simple dependencies
+#############################################
+
+all: manual-html manual-chunk
+
+install: install-manual-pdf install-manual-html install-manual-chunk install-manual-text
+
+clean:
+ -@$(RM) -f $(MANUAL_HTML_TARGET) $(MANUAL_FO_TARGET) $(MANUAL_TEXT_TARGET)
+ -@$(RM) -rf $(MANUAL_CHUNK_DIR)
+ -@$(RM) -f $(MANUAL_PDF_TARGET) $(MANUAL_PS_TARGET)
+
+$(INSTALL_DIR):
+ $(INSTALL) --mode=775 -d $(INSTALL_DIR)
+
+
+###################
+# HTML build rules
+###################
+
+manual-html: $(MANUAL_HTML_TARGET)
+
+$(MANUAL_HTML_TARGET): $(MANUAL_ALL_SOURCE)
+ $(XSLTPROC) --output $(MANUAL_HTML_TARGET) $(XSL_HTML) $(MANUAL_XML_SOURCE)
+
+install-manual-html: $(MANUAL_HTML_TARGET) $(INSTALL_DIR)
+ $(INSTALL) --mode=775 -d $(INSTALL_DIR)/images
+ $(INSTALL) --mode=664 $(MANUAL_HTML_TARGET) $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(STYLES_CSS) $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(MANUAL_HTML_IMAGES) $(INSTALL_DIR)/images
+
+
+###########################
+# Chunked HTML build rules
+##################*########
+
+manual-chunk: $(MANUAL_CHUNK_TARGET)
+
+# The trailing slash in the $(XSLTPROC) command is essential, so that xsltproc will output pages to the dir
+$(MANUAL_CHUNK_TARGET): $(MANUAL_ALL_SOURCE) $(STYLES_CSS) $(MANUAL_HTML_IMAGES)
+ $(MKDIR) -p $(MANUAL_CHUNK_DIR)
+ $(MKDIR) -p $(MANUAL_CHUNK_DIR)/images
+ $(XSLTPROC) --output $(MANUAL_CHUNK_DIR)/ $(XSL_CHUNK) $(MANUAL_XML_SOURCE)
+ $(CP) $(STYLES_CSS) $(MANUAL_CHUNK_DIR)
+ $(CP) $(MANUAL_HTML_IMAGES) $(MANUAL_CHUNK_DIR)/images
+
+install-manual-chunk: $(MANUAL_CHUNK_TARGET) $(INSTALL_DIR)
+ $(INSTALL) --mode=775 -d $(INSTALL_DIR)/images
+ $(INSTALL) --mode=664 $(MANUAL_CHUNK_DIR)/*.html $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(STYLES_CSS) $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(MANUAL_HTML_IMAGES) $(INSTALL_DIR)/images
+
+
+###################
+# Text build rules
+###################
+
+manual-text: manual-html $(MANUAL_TEXT_TARGET)
+
+$(MANUAL_TEXT_TARGET):
+ $(W3M) -dump -cols 80 $(MANUAL_HTML_TARGET) > $(MANUAL_TEXT_TARGET)
+
+install-manual-text: $(MANUAL_TEXT_TARGET) $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(MANUAL_TEXT_TARGET) $(INSTALL_DIR)
+
+
+##################
+# PDF build rules
+##################
+
+manual-pdf: $(MANUAL_PDF_TARGET)
+
+$(MANUAL_PDF_TARGET): $(MANUAL_ALL_SOURCE) $(MANUAL_PDF_IMAGES)
+ # For some reason --output conflicts with admon.graphics.path ?!?!
+ # $(XSLTPROC) --output $(MANUAL_FO_TARGET) $(XSL_FO) $(MANUAL_XML_SOURCE)
+ $(XSLTPROC) $(XSL_FO) $(MANUAL_XML_SOURCE) > $(MANUAL_FO_TARGET)
+ $(FOP) $(MANUAL_TOP) -fo $(MANUAL_FO_TARGET) -pdf $(MANUAL_PDF_TARGET)
+
+install-manual-pdf: $(MANUAL_PDF_TARGET) $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(MANUAL_PDF_TARGET) $(INSTALL_DIR)
+
+
+#########################
+# Postscript build rules
+#########################
+
+manual-ps: $(MANUAL_PS_TARGET)
+
+$(MANUAL_PS_TARGET): $(MANUAL_ALL_SOURCE) $(MANUAL_PDF_IMAGES)
+ $(XSLTPROC) --output $(MANUAL_FO_TARGET) $(XSL_FO) $(MANUAL_XML_SOURCE)
+ $(FOP) $(MANUAL_TOP) -fo $(MANUAL_FO_TARGET) -ps $(MANUAL_PS_TARGET)
+
+install-manual-ps: $(MANUAL_PS_TARGET) $(INSTALL_DIR)
+ $(INSTALL) --mode=664 $(MANUAL_PS_TARGET) $(INSTALL_DIR)
+
Property changes on: cedar-backup2/trunk/doc/pdf/Makefile
___________________________________________________________________
Added: svn:keywords
+ Id
Added: cedar-backup2/trunk/doc/pdf/README.txt
===================================================================
--- cedar-backup2/trunk/doc/pdf/README.txt (rev 0)
+++ cedar-backup2/trunk/doc/pdf/README.txt 2009-03-29 19:35:00 UTC (rev 936)
@@ -0,0 +1,19 @@
+Through Cedar Backup 2.19.2, I supported the user manual in the PDF format.
+Unfortunately, the toolchain changed in early 2009 (when Debian lenny was
+released) and I can no longer build the PDF format properly. The existing
+FOP-based solution simply blows up, and the other alternatives I looked at
+(such as 'xmlto pdf') don't work, either.
+
+As a result, I am removing support for the PDF documentation. I don't
+think it is heavily utilized, and I can't find the time or motivation right
+now to fight with the toolchain. To be honest, I'm quite frustrated that
+somthing which has worked fine for so long is completely broken now. Maybe
+I'm just missing something completely obvious, but I can't find it.
+
+This directory contains the various files that I orphaned when removing PDF
+support. If/when I get PDFs working properly again, this stuff will either
+be integrated back into the codebase proper, or will get removed completely
+(since it will be obsolete).
+
+KJP
+29 Mar 2009
Copied: cedar-backup2/trunk/doc/pdf/fo-stylesheet.xsl (from rev 933, cedar-backup2/trunk/util/docbook/fo-stylesheet.xsl)
===================================================================
--- cedar-backup2/trunk/doc/pdf/fo-stylesheet.xsl (rev 0)
+++ cedar-backup2/trunk/doc/pdf/fo-stylesheet.xsl 2009-03-29 19:35:00 UTC (rev 936)
@@ -0,0 +1,58 @@
+<!--
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Language : XSLT
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : XSLT stylesheet for FO Docbook output (used for PDF and Postscript)
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+-->
+<!--
+ This stylesheet was originally taken from the Subversion project's book
+ (http://svnbook.red-bean.com/) and has been modifed for use with Cedar
+ Backup.
+
+ The original stylesheet was (c) 2000-2004 CollabNet (see CREDITS).
+
+ The major change that I have made to the stylesheet is to use Debian's
+ catalog system for locating the official Docbook stylesheet, rather than
+ expecting it to be part of the source tree. If your operating system does
+ not have a working catalog system, then specify an absolute path to a valid
+ stylesheet below where fo/docbook.xsl is imported (or switch to a real
+ operating system).
+
+ I have also modified the stylesheet to include "admonition" graphics (for
+ warning, tip, note, etc.) in the PDF output, and I now use my own greyscale
+ images for PDF and Postscript (taken from nwalsh's originals and modified)
+ rather than converting the color images from O'Reilly.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
+
+ <xsl:param name="fop.extensions" select="1"/>
+ <xsl:param name="variablelist.as.blocks" select="1"/>
+
+ <xsl:param name="hyphenate">false</xsl:param>
+
+ <xsl:param name="paper.type" select="'USletter'"/>
+
+ <xsl:param name="page.margin.bottom" select="'0.8in'"/>
+ <xsl:param name="page.margin.top" select="'0.8in'"/>
+
+ <xsl:param name="footer.rule" select="0"/>
+
+ <xsl:param name="admon.graphics" select="1"/>
+ <xsl:param name="admon.graphics.extension" select="'.png'"/>
+ <xsl:param name="admon.graphics.path">images/pdf/</xsl:param>
+
+</xsl:stylesheet>
Property changes on: cedar-backup2/trunk/doc/pdf/fo-stylesheet.xsl
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:mergeinfo
+
Property changes on: cedar-backup2/trunk/doc/pdf/images
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: cedar-backup2/trunk/doc/pdf/run-fop.sh (from rev 933, cedar-backup2/trunk/util/docbook/run-fop.sh)
===================================================================
--- cedar-backup2/trunk/doc/pdf/run-fop.sh (rev 0)
+++ cedar-backup2/trunk/doc/pdf/run-fop.sh 2009-03-29 19:35:00 UTC (rev 936)
@@ -0,0 +1,76 @@
+#!/bin/sh
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Language : Bourne Shell
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Wrapper script to run the fop program for PDF and Postscript
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# This script was originally taken from the Subversion project's book
+# (http://svnbook.red-bean.com/). I have not made any modifications to
+# the script for use with Cedar Backup.
+#
+# The original script was (c) 2000-2004 CollabNet (see CREDITS).
+
+# run-fop: Attempt to run fop (or fop.sh), fail articulately otherwise.
+#
+# Usage: run-fop.sh BOOK_TOP [FOP_ARGS...]
+#
+# This script is meant to be invoked by subversion/doc/book/Makefile.
+# The first argument is the top of the book directory, that is,
+# subversion/doc/book (*not* subversion/doc/book/book), and the
+# remaining arguments are passed along to `fop'.
+
+BOOK_TOP=${1}
+
+if [ "${BOOK_TOP}X" = X ]; then
+ echo "usage: run-fop.sh BOOK_TOP [FOP_ARGS...]"
+ exit 1
+fi
+
+shift
+
+# The fop of last resort.
+DESPERATION_FOP_DIR=${BOOK_TOP}/tools/fop
+DESPERATION_FOP_PGM=${DESPERATION_FOP_DIR}/fop.sh
+
+if [ "${FOP_HOME}X" = X ]; then
+ FOP_HOME=${DESPERATION_FOP_DIR}
+ export FOP_HOME
+fi
+
+
+# Unfortunately, 'which' seems to behave slightly differently on every
+# platform, making it unreliable for shell scripts. Just do it inline
+# instead. Also, note that we search for `fop' or `fop.sh', since
+# different systems seem to package it different ways.
+SAVED_IFS=${IFS}
+IFS=:
+for dir in ${PATH}; do
+ if [ -x ${dir}/fop -a "${FOP_PGM}X" = X ]; then
+ FOP_PGM=${dir}/fop
+ elif [ -x ${dir}/fop.sh -a "${FOP_PGM}X" = X ]; then
+ FOP_PGM=${dir}/fop.sh
+ fi
+done
+IFS=${SAVED_IFS}
+
+if [ "${FOP_PGM}X" = X ]; then
+ FOP_PGM=${DESPERATION_FOP_PGM}
+fi
+
+echo "(Using '${FOP_PGM}' for FOP)"
+
+# FOP is noisy on stdout, and -q doesn't seem to help, so stuff that
+# garbage into /dev/null.
+${FOP_PGM} $@ | grep -v "\[ERROR\]"
+#${FOP_PGM} $@
+
Property changes on: cedar-backup2/trunk/doc/pdf/run-fop.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Id
Added: svn:mergeinfo
+
Modified: cedar-backup2/trunk/manual/Makefile
===================================================================
--- cedar-backup2/trunk/manual/Makefile 2009-03-29 18:56:50 UTC (rev 935)
+++ cedar-backup2/trunk/manual/Makefile 2009-03-29 19:35:00 UTC (rev 936)
@@ -24,9 +24,6 @@
# completely rewritten) for use with Cedar Backup.
#
# The original Makefile was (c) 2000-2004 CollabNet (see CREDITS).
-#
-# Note that by default, we only build HTML, HTML chunk and PDF output,
-# not Postscript.
########################
@@ -34,7 +31,6 @@
########################
CP = cp
-FOP = ../util/docbook/run-fop.sh
INSTALL = install
MKDIR = mkdir
RM = rm
@@ -59,14 +55,10 @@
MANUAL_CHUNK_DIR = $(MANUAL_DIR)/chunk
MANUAL_HTML_TARGET = $(MANUAL_DIR)/manual.html
MANUAL_CHUNK_TARGET = $(MANUAL_CHUNK_DIR)/index.html # index.html is created last
-MANUAL_PDF_TARGET = $(MANUAL_DIR)/manual.pdf
-MANUAL_PS_TARGET = $(MANUAL_DIR)/manual.ps
-MANUAL_FO_TARGET = $(MANUAL_DIR)/manual.fo
MANUAL_TEXT_TARGET = $(MANUAL_DIR)/manual.txt
MANUAL_XML_SOURCE = $(MANUAL_DIR)/book.xml
MANUAL_ALL_SOURCE = $(MANUAL_DIR)/*.xml
MANUAL_HTML_IMAGES = $(MANUAL_DIR)/images/html/*.png
-MANUAL_PDF_IMAGES = $(MANUAL_DIR)/images/pdf/*.png
#############################################
@@ -75,12 +67,11 @@
all: manual-html manual-chunk
-install: install-manual-pdf install-manual-html install-manual-chunk install-manual-text
+install: install-manual-html install-manual-chunk install-manual-text
clean:
-@$(RM) -f $(MANUAL_HTML_TARGET) $(MANUAL_FO_TARGET) $(MANUAL_TEXT_TARGET)
-@$(RM) -rf $(MANUAL_CHUNK_DIR)
- -@$(RM) -f $(MANUAL_PDF_TARGET) $(MANUAL_PS_TARGET)
$(INSTALL_DIR):
$(INSTALL) --mode=775 -d $(INSTALL_DIR)
@@ -136,32 +127,3 @@
$(INSTALL) --mode=664 $(MANUAL_TEXT_TARGET) $(INSTALL_DIR)
-##################
-# PDF build rules
-##################
-
-manual-pdf: $(MANUAL_PDF_TARGET)
-
-$(MANUAL_PDF_TARGET): $(MANUAL_ALL_SOURCE) $(MANUAL_PDF_IMAGES)
- # For some reason --output conflicts with admon.graphics.path ?!?!
- # $(XSLTPROC) --output $(MANUAL_FO_TARGET) $(XSL_FO) $(MANUAL_XML_SOURCE)
- $(XSLTPROC) $(XSL_FO) $(MANUAL_XML_SOURCE) > $(MANUAL_FO_TARGET)
- $(FOP) $(MANUAL_TOP) -fo $(MANUAL_FO_TARGET) -pdf $(MANUAL_PDF_TARGET)
-
-install-manual-pdf: $(MANUAL_PDF_TARGET) $(INSTALL_DIR)
- $(INSTALL) --mode=664 $(MANUAL_PDF_TARGET) $(INSTALL_DIR)
-
-
-#########################
-# Postscript build rules
-#########################
-
-manual-ps: $(MANUAL_PS_TARGET)
-
-$(MANUAL_PS_TARGET): $(MANUAL_ALL_SOURCE) $(MANUAL_PDF_IMAGES)
- $(XSLTPROC) --output $(MANUAL_FO_TARGET) $(XSL_FO) $(MANUAL_XML_SOURCE)
- $(FOP) $(MANUAL_TOP) -fo $(MANUAL_FO_TARGET) -ps $(MANUAL_PS_TARGET)
-
-install-manual-ps: $(MANUAL_PS_TARGET) $(INSTALL_DIR)
- $(INSTALL) --mode=664 $(MANUAL_PS_TARGET) $(INSTALL_DIR)
-
Deleted: cedar-backup2/trunk/util/docbook/fo-stylesheet.xsl
===================================================================
--- cedar-backup2/trunk/util/docbook/fo-stylesheet.xsl 2009-03-29 18:56:50 UTC (rev 935)
+++ cedar-backup2/trunk/util/docbook/fo-stylesheet.xsl 2009-03-29 19:35:00 UTC (rev 936)
@@ -1,58 +0,0 @@
-<!--
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-#
-# C E D A R
-# S O L U T I O N S "Software done right."
-# S O F T W A R E
-#
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-#
-# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : XSLT
-# Project : Cedar Backup, release 2
-# Revision : $Id$
-# Purpose : XSLT stylesheet for FO Docbook output (used for PDF and Postscript)
-#
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
--->
-<!--
- This stylesheet was originally taken from the Subversion project's book
- (http://svnbook.red-bean.com/) and has been modifed for use with Cedar
- Backup.
-
- The original stylesheet was (c) 2000-2004 CollabNet (see CREDITS).
-
- The major change that I have made to the stylesheet is to use Debian's
- catalog system for locating the official Docbook stylesheet, rather than
- expecting it to be part of the source tree. If your operating system does
- not have a working catalog system, then specify an absolute path to a valid
- stylesheet below where fo/docbook.xsl is imported (or switch to a real
- operating system).
-
- I have also modified the stylesheet to include "admonition" graphics (for
- warning, tip, note, etc.) in the PDF output, and I now use my own greyscale
- images for PDF and Postscript (taken from nwalsh's originals and modified)
- rather than converting the color images from O'Reilly.
--->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
-
- <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
-
- <xsl:param name="fop.extensions" select="1"/>
- <xsl:param name="variablelist.as.blocks" select="1"/>
-
- <xsl:param name="hyphenate">false</xsl:param>
-
- <xsl:param name="paper.type" select="'USletter'"/>
-
- <xsl:param name="page.margin.bottom" select="'0.8in'"/>
- <xsl:param name="page.margin.top" select="'0.8in'"/>
-
- <xsl:param name="footer.rule" select="0"/>
-
- <xsl:param name="admon.graphics" select="1"/>
- <xsl:param name="admon.graphics.extension" select="'.png'"/>
- <xsl:param name="admon.graphics.path">images/pdf/</xsl:param>
-
-</xsl:stylesheet>
Deleted: cedar-backup2/trunk/util/docbook/run-fop.sh
===================================================================
--- cedar-backup2/trunk/util/docbook/run-fop.sh 2009-03-29 18:56:50 UTC (rev 935)
+++ cedar-backup2/trunk/util/docbook/run-fop.sh 2009-03-29 19:35:00 UTC (rev 936)
@@ -1,76 +0,0 @@
-#!/bin/sh
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-#
-# C E D A R
-# S O L U T I O N S "Software done right."
-# S O F T W A R E
-#
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-#
-# Author : Kenneth J. Pronovici <pro...@ie...>
-# Language : Bourne Shell
-# Project : Cedar Backup, release 2
-# Revision : $Id$
-# Purpose : Wrapper script to run the fop program for PDF and Postscript
-#
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# This script was originally taken from the Subversion project's book
-# (http://svnbook.red-bean.com/). I have not made any modifications to
-# the script for use with Cedar Backup.
-#
-# The original script was (c) 2000-2004 CollabNet (see CREDITS).
-
-# run-fop: Attempt to run fop (or fop.sh), fail articulately otherwise.
-#
-# Usage: run-fop.sh BOOK_TOP [FOP_ARGS...]
-#
-# This script is meant to be invoked by subversion/doc/book/Makefile.
-# The first argument is the top of the book directory, that is,
-# subversion/doc/book (*not* subversion/doc/book/book), and the
-# remaining arguments are passed along to `fop'.
-
-BOOK_TOP=${1}
-
-if [ "${BOOK_TOP}X" = X ]; then
- echo "usage: run-fop.sh BOOK_TOP [FOP_ARGS...]"
- exit 1
-fi
-
-shift
-
-# The fop of last resort.
-DESPERATION_FOP_DIR=${BOOK_TOP}/tools/fop
-DESPERATION_FOP_PGM=${DESPERATION_FOP_DIR}/fop.sh
-
-if [ "${FOP_HOME}X" = X ]; then
- FOP_HOME=${DESPERATION_FOP_DIR}
- export FOP_HOME
-fi
-
-
-# Unfortunately, 'which' seems to behave slightly differently on every
-# platform, making it unreliable for shell scripts. Just do it inline
-# instead. Also, note that we search for `fop' or `fop.sh', since
-# different systems seem to package it different ways.
-SAVED_IFS=${IFS}
-IFS=:
-for dir in ${PATH}; do
- if [ -x ${dir}/fop -a "${FOP_PGM}X" = X ]; then
- FOP_PGM=${dir}/fop
- elif [ -x ${dir}/fop.sh -a "${FOP_PGM}X" = X ]; then
- FOP_PGM=${dir}/fop.sh
- fi
-done
-IFS=${SAVED_IFS}
-
-if [ "${FOP_PGM}X" = X ]; then
- FOP_PGM=${DESPERATION_FOP_PGM}
-fi
-
-echo "(Using '${FOP_PGM}' for FOP)"
-
-# FOP is noisy on stdout, and -q doesn't seem to help, so stuff that
-# garbage into /dev/null.
-${FOP_PGM} $@ | grep -v "\[ERROR\]"
-#${FOP_PGM} $@
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-03-29 19:36:55
|
Revision: 937
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=937&view=rev
Author: pronovic
Date: 2009-03-29 19:36:51 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
Release 2.19.3
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2009-03-29 19:35:00 UTC (rev 936)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2009-03-29 19:36:51 UTC (rev 937)
@@ -33,8 +33,8 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
-COPYRIGHT = "2004-2008"
-VERSION = "2.19.2"
-DATE = "08 Dec 2008"
+COPYRIGHT = "2004-2009"
+VERSION = "2.19.3"
+DATE = "29 Mar 2009"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-03-29 19:35:00 UTC (rev 936)
+++ cedar-backup2/trunk/Changelog 2009-03-29 19:36:51 UTC (rev 937)
@@ -1,4 +1,4 @@
-Version 2.19.3 unreleased
+Version 2.19.3 29 Mar 2009
* Fix minor epydoc typos, mostly in @sort directives.
* Removed support for user manual PDF format (see doc/pdf).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-08-16 18:21:43
|
Revision: 945
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=945&view=rev
Author: pronovic
Date: 2009-08-16 18:21:36 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Fix testGenerateTarfile_002() so it works with Python 2.6
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/test/filesystemtests.py
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-03-29 19:52:00 UTC (rev 944)
+++ cedar-backup2/trunk/Changelog 2009-08-16 18:21:36 UTC (rev 945)
@@ -1,3 +1,7 @@
+Version 2.19.4 unreleased
+
+ * Fix testGenerateTarfile_002() so it works with Python 2.6.
+
Version 2.19.3 29 Mar 2009
* Fix minor epydoc typos, mostly in @sort directives.
Modified: cedar-backup2/trunk/test/filesystemtests.py
===================================================================
--- cedar-backup2/trunk/test/filesystemtests.py 2009-03-29 19:52:00 UTC (rev 944)
+++ cedar-backup2/trunk/test/filesystemtests.py 2009-08-16 18:21:36 UTC (rev 945)
@@ -17212,7 +17212,8 @@
tarFile.close()
self.failUnlessEqual(11, len(tarList))
self.failUnless(self.tarPath([ "tree9", "dir001/" ]) in tarList
- or self.tarPath([ "tree9", "dir001//" ]) in tarList) # Grr... Python 2.5 behavior differs
+ or self.tarPath([ "tree9", "dir001//" ]) in tarList # Grr... Python 2.5 behavior differs
+ or self.tarPath([ "tree9", "dir001", ]) in tarList) # Grr... Python 2.6 behavior differs
self.failUnless(self.tarPath([ "tree9", "dir001", "file001", ]) in tarList)
self.failUnless(self.tarPath([ "tree9", "dir001", "file002", ]) in tarList)
self.failUnless(self.tarPath([ "tree9", "dir001", "link001", ]) in tarList)
@@ -17252,7 +17253,8 @@
tarFile.close()
self.failUnlessEqual(16, len(tarList))
self.failUnless(self.tarPath([ "tree9", "dir001/" ]) in tarList
- or self.tarPath([ "tree9", "dir001//" ]) in tarList) # Grr... Python 2.5 behavior differs
+ or self.tarPath([ "tree9", "dir001//" ]) in tarList # Grr... Python 2.5 behavior differs
+ or self.tarPath([ "tree9", "dir001", ]) in tarList) # Grr... Python 2.6 behavior differs
self.failUnless(self.tarPath([ "tree9", "dir001", "file001", ]) in tarList)
self.failUnless(self.tarPath([ "tree9", "dir001", "file002", ]) in tarList)
self.failUnless(self.tarPath([ "tree9", "dir001", "link001", ]) in tarList)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-08-16 18:39:26
|
Revision: 946
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=946&view=rev
Author: pronovic
Date: 2009-08-16 18:39:18 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Use hashlib instead of deprecated sha module when available.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/test/filesystemtests.py
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-08-16 18:21:36 UTC (rev 945)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-08-16 18:39:18 UTC (rev 946)
@@ -51,7 +51,6 @@
import sys
import os
import re
-import sha
import math
import logging
import tarfile
@@ -899,7 +898,7 @@
requires 111 seconds. This implementation requires only 40-45 seconds,
which is a pretty substantial speed-up.
- Practice shows that reading in around 4kB (4096 bytes) at a time yields
+ Experience shows that reading in around 4kB (4096 bytes) at a time yields
the best performance. Smaller reads are quite a bit slower, and larger
reads don't make much of a difference. The 4kB number makes me a little
suspicious, and I think it might be related to the size of a filesystem
@@ -912,7 +911,12 @@
@return: ASCII-safe SHA digest for the file.
@raise OSError: If the file cannot be opened.
"""
- s = sha.new()
+ try:
+ import hashlib
+ s = hashlib.sha1()
+ except Exception, e:
+ import sha
+ s = sha.new()
f = open(path, mode="rb") # in case platform cares about binary reads
readBytes = 4096 # see notes above
while(readBytes > 0):
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-08-16 18:21:36 UTC (rev 945)
+++ cedar-backup2/trunk/Changelog 2009-08-16 18:39:18 UTC (rev 946)
@@ -1,6 +1,7 @@
Version 2.19.4 unreleased
* Fix testGenerateTarfile_002() so it works with Python 2.6.
+ * Use hashlib instead of deprecated sha module when available.
Version 2.19.3 29 Mar 2009
Modified: cedar-backup2/trunk/test/filesystemtests.py
===================================================================
--- cedar-backup2/trunk/test/filesystemtests.py 2009-08-16 18:21:36 UTC (rev 945)
+++ cedar-backup2/trunk/test/filesystemtests.py 2009-08-16 18:39:18 UTC (rev 946)
@@ -112,7 +112,6 @@
import sys
import os
-import sha
import time
import unittest
import tempfile
@@ -19381,9 +19380,19 @@
for key in self.resources.keys():
path = self.resources[key]
if platformRequiresBinaryRead():
- digest1 = sha.new(open(path, mode="rb").read()).hexdigest()
+ try:
+ import hashlib
+ digest1 = haslib.sha1(open(path, mode="rb").read()).hexdigest()
+ except:
+ import sha
+ digest1 = sha.new(open(path, mode="rb").read()).hexdigest()
else:
- digest1 = sha.new(open(path).read()).hexdigest()
+ try:
+ import hashlib
+ digest1 = hashlib.sha1(open(path).read()).hexdigest()
+ except:
+ import sha
+ digest1 = sha.new(open(path).read()).hexdigest()
digest2 = BackupFileList._generateDigest(path)
self.failUnlessEqual(digest1, digest2, "Digest for %s varies: [%s] vs [%s]." % (path, digest1, digest2))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-08-16 18:47:42
|
Revision: 947
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=947&view=rev
Author: pronovic
Date: 2009-08-16 18:47:36 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Use set built-in rather than deprecated sets.Set when available.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2009-08-16 18:39:18 UTC (rev 946)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2009-08-16 18:47:36 UTC (rev 947)
@@ -56,7 +56,6 @@
import os
import logging
import shutil
-import sets
import re
# Cedar Backup modules
@@ -923,8 +922,7 @@
Returns the contents of a directory in terms of a Set.
The directory's contents are read as a L{FilesystemList} containing only
- files, and then the list is converted into a C{sets.Set} object for later
- use.
+ files, and then the list is converted into a set object for later use.
@param path: Directory path to get contents for
@type path: String representing a path on disk
@@ -936,7 +934,11 @@
contents.excludeDirs = True
contents.excludeLinks = True
contents.addDirContents(path)
- return sets.Set(contents)
+ try:
+ return set(contents)
+ except:
+ import sets
+ return sets.Set(contents)
_getDirContents = staticmethod(_getDirContents)
def _copyRemoteDir(remoteUser, localUser, remoteHost, rcpCommand, rcpCommandList,
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-08-16 18:39:18 UTC (rev 946)
+++ cedar-backup2/trunk/Changelog 2009-08-16 18:47:36 UTC (rev 947)
@@ -2,6 +2,7 @@
* Fix testGenerateTarfile_002() so it works with Python 2.6.
* Use hashlib instead of deprecated sha module when available.
+ * Use set built-in rather than deprecated sets.Set when available.
Version 2.19.3 29 Mar 2009
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-08-16 18:56:07
|
Revision: 948
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=948&view=rev
Author: pronovic
Date: 2009-08-16 18:55:56 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Use tarfile.format=GNU_FORMAT rather than deprecated tarfile.posix=False.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-08-16 18:47:36 UTC (rev 947)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-08-16 18:55:56 UTC (rev 948)
@@ -1105,7 +1105,10 @@
else: raise ValueError("Mode [%s] is not valid." % mode)
try:
tar = tarfile.open(path, tarmode)
- tar.posix = False # make a GNU-compatible archive without file length limits
+ try:
+ tar.format = tarfile.GNU_FORMAT
+ except:
+ tar.posix = False
for entry in self:
try:
if flat:
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2009-08-16 18:47:36 UTC (rev 947)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2009-08-16 18:55:56 UTC (rev 948)
@@ -207,7 +207,10 @@
tmpdir = encodePath(tmpdir)
filepath = encodePath(filepath)
tar = tarfile.open(filepath)
- tar.posix = False
+ try:
+ tar.format = tarfile.GNU_FORMAT
+ except:
+ tar.posix = False
for tarinfo in tar:
tar.extract(tarinfo, tmpdir)
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-08-16 18:47:36 UTC (rev 947)
+++ cedar-backup2/trunk/Changelog 2009-08-16 18:55:56 UTC (rev 948)
@@ -1,8 +1,9 @@
Version 2.19.4 unreleased
- * Fix testGenerateTarfile_002() so it works with Python 2.6.
- * Use hashlib instead of deprecated sha module when available.
- * Use set built-in rather than deprecated sets.Set when available.
+ * Use hashlib module instead of deprecated sha module when available.
+ * Use set built-in type rather than deprecated sets.Set class when available.
+ * Use tarfile.format=GNU_FORMAT rather than deprecated tarfile.posix=False.
+ * Fix testGenerateTarfile_002() so expectations match Python 2.6 results.
Version 2.19.3 29 Mar 2009
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2009-08-16 20:12:18
|
Revision: 950
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=950&view=rev
Author: pronovic
Date: 2009-08-16 20:12:09 +0000 (Sun, 16 Aug 2009)
Log Message:
-----------
Release 2.19.4
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/filesystem.py
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/filesystem.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-08-16 20:04:58 UTC (rev 949)
+++ cedar-backup2/trunk/CedarBackup2/filesystem.py 2009-08-16 20:12:09 UTC (rev 950)
@@ -914,7 +914,7 @@
try:
import hashlib
s = hashlib.sha1()
- except Exception, e:
+ except:
import sha
s = sha.new()
f = open(path, mode="rb") # in case platform cares about binary reads
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2009-08-16 20:04:58 UTC (rev 949)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2009-08-16 20:12:09 UTC (rev 950)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2009"
-VERSION = "2.19.3"
-DATE = "29 Mar 2009"
+VERSION = "2.19.4"
+DATE = "16 Aug 2009"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-08-16 20:04:58 UTC (rev 949)
+++ cedar-backup2/trunk/Changelog 2009-08-16 20:12:09 UTC (rev 950)
@@ -1,9 +1,10 @@
-Version 2.19.4 unreleased
+Version 2.19.4 16 Aug 2009
- * Use hashlib module instead of deprecated sha module when available.
- * Use set built-in type rather than deprecated sets.Set class when available.
- * Use tarfile.format=GNU_FORMAT rather than deprecated tarfile.posix=False.
- * Fix testGenerateTarfile_002() so expectations match Python 2.6 results.
+ * Add support for the Python 2.6 interpreter.
+ - Use hashlib instead of deprecated sha module when available
+ - Use set type rather than deprecated sets.Set when available
+ - Use tarfile.format rather than deprecated tarfile.posix when available
+ - Fix testGenerateTarfile_002() so expectations match Python 2.6 results
Version 2.19.3 29 Mar 2009
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-01-10 20:12:01
|
Revision: 952
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=952&view=rev
Author: pronovic
Date: 2010-01-10 20:11:53 +0000 (Sun, 10 Jan 2010)
Log Message:
-----------
Add support for customization, so Debian can use wodim and genisoimage
Modified Paths:
--------------
cedar-backup2/trunk/CREDITS
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/test/configtests.py
cedar-backup2/trunk/util/test.py
Added Paths:
-----------
cedar-backup2/trunk/CedarBackup2/customize.py
cedar-backup2/trunk/test/customizetests.py
Modified: cedar-backup2/trunk/CREDITS
===================================================================
--- cedar-backup2/trunk/CREDITS 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/CREDITS 2010-01-10 20:11:53 UTC (rev 952)
@@ -23,7 +23,7 @@
software, as indicated in the source code itself.
Unless otherwise indicated, all Cedar Backup source code is Copyright
-(c) 2004-2009 Kenneth J. Pronovici and is released under the GNU General
+(c) 2004-2010 Kenneth J. Pronovici and is released under the GNU General
Public License. The contents of the GNU General Public License can be
found in the LICENSE file, or can be downloaded from http://www.gnu.org/.
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2007,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -87,6 +87,7 @@
# Cedar Backup modules
from CedarBackup2.release import AUTHOR, EMAIL, VERSION, DATE, COPYRIGHT
+from CedarBackup2.customize import customizeOverrides
from CedarBackup2.util import RestrictedContentList, DirectedGraph, PathResolverSingleton
from CedarBackup2.util import sortDict, splitCommandLine, executeCommand, getFunctionReference
from CedarBackup2.util import getUidGid, encodePath, Diagnostics
@@ -243,6 +244,7 @@
try:
logger.info("Configuration path is [%s]" % configPath)
config = Config(xmlPath=configPath)
+ customizeOverrides(config)
setupPathResolver(config)
actionSet = _ActionSet(options.actions, config.extensions, config.options,
config.peers, executeManaged, executeLocal)
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -2622,6 +2622,35 @@
return 1
return 0
+ def addOverride(self, command, absolutePath):
+ """
+ If no override currently exists for the command, add one.
+ @param command: Name of command to be overridden.
+ @param absolutePath: Absolute path of the overrridden command.
+ """
+ exists = False
+ for object in self.overrides:
+ if object.command == command:
+ exists = True
+ break
+ if not exists:
+ self.overrides.append(CommandOverride(command, absolutePath))
+
+ def replaceOverride(self, command, absolutePath):
+ """
+ If override currently exists for the command, replace it; otherwise add it.
+ @param command: Name of command to be overridden.
+ @param absolutePath: Absolute path of the overrridden command.
+ """
+ exists = False
+ for object in self.overrides:
+ if object.command == command:
+ exists = True
+ object.absolutePath = absolutePath
+ break
+ if not exists:
+ self.overrides.append(CommandOverride(command, absolutePath))
+
def _setStartingDay(self, value):
"""
Property target used to set the starting day.
Added: cedar-backup2/trunk/CedarBackup2/customize.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/customize.py (rev 0)
+++ cedar-backup2/trunk/CedarBackup2/customize.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -0,0 +1,97 @@
+# -*- coding: iso-8859-1 -*-
+# vim: set ft=python ts=3 sw=3 expandtab:
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Copyright (c) 2010 Kenneth J. Pronovici.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License,
+# Version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copies of the GNU General Public License are available from
+# the Free Software Foundation website, http://www.gnu.org/.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Language : Python (>= 2.3)
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Implements customized behavior.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+########################################################################
+# Module documentation
+########################################################################
+
+"""
+Implements customized behavior.
+
+Some behaviors need to vary when packaged for certain platforms. For instance,
+while Cedar Backup generally uses cdrecord and mkisofs, Debian ships compatible
+utilities called wodim and genisoimage. I want there to be one single place
+where Cedar Backup is patched for Debian, rather than having to maintain a
+variety of patches in different places.
+
+@author: Kenneth J. Pronovici <pro...@ie...>
+"""
+
+########################################################################
+# Imported modules
+########################################################################
+
+# System modules
+import logging
+
+
+########################################################################
+# Module-wide constants and variables
+########################################################################
+
+logger = logging.getLogger("CedarBackup2.log.customize")
+
+PLATFORM = "standard"
+#PLATFORM = "debian"
+
+DEBIAN_CDRECORD = "/usr/bin/wodim"
+DEBIAN_MKISOFS = "/usr/bin/genisoimage"
+
+
+#######################################################################
+# Public functions
+#######################################################################
+
+################################
+# customizeOverrides() function
+################################
+
+def customizeOverrides(config, platform=PLATFORM):
+ """
+ Modify command overrides based on the configured platform.
+
+ On some platforms, we want to add command overrides to configuration. Each
+ override will only be added if the configuration does not already contain an
+ override with the same name. That way, the user still has a way to choose
+ their own version of the command if they want.
+
+ @param config: Configuration to modify
+ @param platform: Platform that is in use
+ """
+ if platform == "debian":
+ logger.info("Overriding cdrecord for Debian platform: %s" % DEBIAN_CDRECORD)
+ config.options.addOverride("cdrecord", DEBIAN_CDRECORD)
+ logger.info("Overriding mkisofs for Debian platform: %s" % DEBIAN_MKISOFS)
+ config.options.addOverride("mkisofs", DEBIAN_MKISOFS)
+
Property changes on: cedar-backup2/trunk/CedarBackup2/customize.py
___________________________________________________________________
Added: svn:keywords
+ Id
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -33,8 +33,8 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
-COPYRIGHT = "2004-2009"
-VERSION = "2.19.4"
-DATE = "16 Aug 2009"
+COPYRIGHT = "2004-2010"
+VERSION = "2.19.5"
+DATE = "unreleased"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/Changelog 2010-01-10 20:11:53 UTC (rev 952)
@@ -1,3 +1,7 @@
+Version 2.19.5 unreleased
+
+ * Add customization support, so Debian can use wodim and genisoimage.
+
Version 2.19.4 16 Aug 2009
* Add support for the Python 2.6 interpreter.
Modified: cedar-backup2/trunk/test/configtests.py
===================================================================
--- cedar-backup2/trunk/test/configtests.py 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/test/configtests.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -6031,6 +6031,66 @@
self.failUnless(options1 != options2)
+ ####################################
+ # Test add and replace of overrides
+ ####################################
+
+ def testOverrides_001(self):
+ """
+ Test addOverride() with no existing overrides.
+ """
+ options = OptionsConfig();
+ options.overrides = []
+ options.addOverride("cdrecord", "/usr/bin/wodim")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+
+ def testOverrides_002(self):
+ """
+ Test addOverride() with no existing override that matches.
+ """
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("one", "/one"), ]
+ options.addOverride("cdrecord", "/usr/bin/wodim")
+ self.failUnlessEqual([ CommandOverride("one", "/one"), CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+
+ def testOverrides_003(self):
+ """
+ Test addOverride(), with existing override that matches.
+ """
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("cdrecord", "/one"), ]
+ options.addOverride("cdrecord", "/usr/bin/wodim")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/one"), ], options.overrides);
+
+ def testOverrides_004(self):
+ """
+ Test replaceOverride() with no existing overrides.
+ """
+ options = OptionsConfig();
+ options.overrides = []
+ options.replaceOverride("cdrecord", "/usr/bin/wodim")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+
+ def testOverrides_005(self):
+ """
+ Test replaceOverride() with no existing override that matches.
+ """
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("one", "/one"), ]
+ options.replaceOverride("cdrecord", "/usr/bin/wodim")
+ self.failUnlessEqual([ CommandOverride("one", "/one"), CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+
+ def testOverrides_006(self):
+ """
+ Test replaceOverride(), with existing override that matches.
+ """
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("cdrecord", "/one"), ]
+ options.replaceOverride("cdrecord", "/usr/bin/wodim")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
+
+
+
########################
# TestPeersConfig class
########################
Added: cedar-backup2/trunk/test/customizetests.py
===================================================================
--- cedar-backup2/trunk/test/customizetests.py (rev 0)
+++ cedar-backup2/trunk/test/customizetests.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -0,0 +1,193 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+# vim: set ft=python ts=3 sw=3 expandtab:
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Copyright (c) 2010 Kenneth J. Pronovici.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License,
+# Version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copies of the GNU General Public License are available from
+# the Free Software Foundation website, http://www.gnu.org/.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Language : Python (>= 2.3)
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Tests customization functionality.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+########################################################################
+# Module documentation
+########################################################################
+
+"""
+Unit tests for CedarBackup2/customize.py.
+@author Kenneth J. Pronovici <pro...@ie...>
+"""
+
+
+########################################################################
+# Import modules and do runtime validations
+########################################################################
+
+import unittest
+
+from CedarBackup2.customize import customizeOverrides
+from CedarBackup2.config import Config, OptionsConfig, CommandOverride
+
+
+
+#######################################################################
+# Test Case Classes
+#######################################################################
+
+######################
+# TestFunctions class
+######################
+
+class TestFunctions(unittest.TestCase):
+
+ """Tests for the various public functions."""
+
+
+ ############################
+ # Test customizeOverrides()
+ ############################
+
+ def testCustomizeOverrides_001(self):
+ """
+ Test platform=standard, no existing overrides.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = []
+ config.options = options
+ customizeOverrides(config) # relies on default, which should be "standard"
+ self.failUnlessEqual([], options.overrides);
+ config.options = options
+ customizeOverrides(config, platform="standard")
+ self.failUnlessEqual([], options.overrides);
+
+ def testCustomizeOverrides_002(self):
+ """
+ Test platform=standard, existing override for cdrecord.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("cdrecord", "/blech"), ]
+ config.options = options
+ customizeOverrides(config) # relies on default, which should be "standard"
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/blech"), ], options.overrides);
+ config.options = options
+ customizeOverrides(config, platform="standard")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/blech"), ], options.overrides);
+
+ def testCustomizeOverrides_003(self):
+ """
+ Test platform=standard, existing override for mkisofs.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("mkisofs", "/blech"), ]
+ config.options = options
+ customizeOverrides(config) # relies on default, which should be "standard"
+ self.failUnlessEqual([ CommandOverride("mkisofs", "/blech"), ], options.overrides);
+ config.options = options
+ customizeOverrides(config, platform="standard")
+ self.failUnlessEqual([ CommandOverride("mkisofs", "/blech"), ], options.overrides);
+
+ def testCustomizeOverrides_004(self):
+ """
+ Test platform=standard, existing override for cdrecord and mkisofs.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("cdrecord", "/blech"), CommandOverride("mkisofs", "/blech2"), ]
+ config.options = options
+ customizeOverrides(config) # relies on default, which should be "standard"
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/blech"), CommandOverride("mkisofs", "/blech2"), ], options.overrides);
+ config.options = options
+ customizeOverrides(config, platform="standard")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/blech"), CommandOverride("mkisofs", "/blech2"), ], options.overrides);
+
+ def testCustomizeOverrides_005(self):
+ """
+ Test platform=debian, no existing overrides.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = []
+ config.options = options
+ customizeOverrides(config, platform="debian")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), CommandOverride("mkisofs", "/usr/bin/genisoimage"), ], options.overrides);
+
+ def testCustomizeOverrides_006(self):
+ """
+ Test platform=debian, existing override for cdrecord.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("cdrecord", "/blech"), ]
+ config.options = options
+ customizeOverrides(config, platform="debian")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/blech"), CommandOverride("mkisofs", "/usr/bin/genisoimage"), ], options.overrides);
+
+ def testCustomizeOverrides_007(self):
+ """
+ Test platform=debian, existing override for mkisofs.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("mkisofs", "/blech"), ]
+ config.options = options
+ customizeOverrides(config, platform="debian")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), CommandOverride("mkisofs", "/blech"), ], options.overrides);
+
+ def testCustomizeOverrides_008(self):
+ """
+ Test platform=debian, existing override for cdrecord and mkisofs.
+ """
+ config = Config()
+ options = OptionsConfig();
+ options.overrides = [ CommandOverride("cdrecord", "/blech"), CommandOverride("mkisofs", "/blech2"), ]
+ config.options = options
+ customizeOverrides(config, platform="debian")
+ self.failUnlessEqual([ CommandOverride("cdrecord", "/blech"), CommandOverride("mkisofs", "/blech2"), ], options.overrides);
+
+
+#######################################################################
+# Suite definition
+#######################################################################
+
+def suite():
+ """Returns a suite containing all the test cases in this module."""
+ return unittest.TestSuite((
+ unittest.makeSuite(TestFunctions, 'test'),
+ ))
+
+
+########################################################################
+# Module entry point
+########################################################################
+
+# When this module is executed from the command-line, run its tests
+if __name__ == '__main__':
+ unittest.main()
+
Property changes on: cedar-backup2/trunk/test/customizetests.py
___________________________________________________________________
Added: svn:keywords
+ Id
Modified: cedar-backup2/trunk/util/test.py
===================================================================
--- cedar-backup2/trunk/util/test.py 2009-08-16 20:37:19 UTC (rev 951)
+++ cedar-backup2/trunk/util/test.py 2010-01-10 20:11:53 UTC (rev 952)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2008 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008,2010 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -163,6 +163,7 @@
import test.splittests as splittests
import test.spantests as spantests
import test.capacitytests as capacitytests
+ import test.customizetests as customizetests
except ImportError, e:
print "Failed to import CedarBackup2 unit test module: %s" % e
print "You must either run the unit tests from the CedarBackup2 source"
@@ -220,6 +221,7 @@
if args == [] or "encrypt" in args: unittests["encrypt"] = encrypttests.suite()
if args == [] or "span" in args: unittests["span"] = spantests.suite()
if args == [] or "capacity" in args: unittests["capacity"] = capacitytests.suite()
+ if args == [] or "customize" in args: unittests["customize"] = customizetests.suite()
if args != []: print "*** Executing specific tests: %s" % unittests.keys()
# Print some diagnostic information
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-01-10 22:49:35
|
Revision: 956
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=956&view=rev
Author: pronovic
Date: 2010-01-10 22:49:01 +0000 (Sun, 10 Jan 2010)
Log Message:
-----------
SF bug #2929447 - fix cback-span to only ask for media when needed
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/tools/span.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/tools/span.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-01-10 22:31:08 UTC (rev 955)
+++ cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-01-10 22:49:01 UTC (rev 956)
@@ -401,17 +401,18 @@
happy = True
print "==="
- print ""
- _getReturn("Please place the first disc in your backup device.\nPress return when ready.")
- print "==="
-
counter = 0
for spanItem in spanSet:
counter += 1
+ if counter == 1:
+ print ""
+ _getReturn("Please place the first disc in your backup device.\nPress return when ready.")
+ print "==="
+ else:
+ print ""
+ _getReturn("Please replace the disc in your backup device.\nPress return when ready.")
+ print "==="
_writeDisc(config, writer, spanItem)
- print ""
- _getReturn("Please replace the disc in your backup device.\nPress return when ready.")
- print "==="
_writeStoreIndicator(config, dailyDirs)
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-01-10 22:31:08 UTC (rev 955)
+++ cedar-backup2/trunk/Changelog 2010-01-10 22:49:01 UTC (rev 956)
@@ -1,6 +1,7 @@
Version 2.19.5 unreleased
* Add customization support, so Debian can use wodim and genisoimage.
+ * SF bug #2929447 - fix cback-span to only ask for media when needed
* SF bug #2929446 - add retry logic for writes in cback-span
Version 2.19.4 16 Aug 2009
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-01-10 22:54:29
|
Revision: 957
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=957&view=rev
Author: pronovic
Date: 2010-01-10 22:54:17 +0000 (Sun, 10 Jan 2010)
Log Message:
-----------
Release 2.19.5
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-01-10 22:49:01 UTC (rev 956)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-01-10 22:54:17 UTC (rev 957)
@@ -35,6 +35,6 @@
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
VERSION = "2.19.5"
-DATE = "unreleased"
+DATE = "10 Jan 2010"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-01-10 22:49:01 UTC (rev 956)
+++ cedar-backup2/trunk/Changelog 2010-01-10 22:54:17 UTC (rev 957)
@@ -1,4 +1,4 @@
-Version 2.19.5 unreleased
+Version 2.19.5 10 Jan 2010
* Add customization support, so Debian can use wodim and genisoimage.
* SF bug #2929447 - fix cback-span to only ask for media when needed
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-01-10 23:57:22
|
Revision: 963
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=963&view=rev
Author: pronovic
Date: 2010-01-10 23:57:16 +0000 (Sun, 10 Jan 2010)
Log Message:
-----------
Properly handle config.options.overrides=None
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/test/configtests.py
cedar-backup2/trunk/test/customizetests.py
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-01-10 23:24:37 UTC (rev 962)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-01-10 23:57:16 UTC (rev 963)
@@ -2628,13 +2628,17 @@
@param command: Name of command to be overridden.
@param absolutePath: Absolute path of the overrridden command.
"""
- exists = False
- for object in self.overrides:
- if object.command == command:
- exists = True
- break
- if not exists:
- self.overrides.append(CommandOverride(command, absolutePath))
+ override = CommandOverride(command, absolutePath)
+ if self.overrides is None:
+ self.overrides = [ override, ]
+ else:
+ exists = False
+ for object in self.overrides:
+ if object.command == override.command:
+ exists = True
+ break
+ if not exists:
+ self.overrides.append(override)
def replaceOverride(self, command, absolutePath):
"""
@@ -2642,14 +2646,18 @@
@param command: Name of command to be overridden.
@param absolutePath: Absolute path of the overrridden command.
"""
- exists = False
- for object in self.overrides:
- if object.command == command:
- exists = True
- object.absolutePath = absolutePath
- break
- if not exists:
- self.overrides.append(CommandOverride(command, absolutePath))
+ override = CommandOverride(command, absolutePath)
+ if self.overrides is None:
+ self.overrides = [ override, ]
+ else:
+ exists = False
+ for object in self.overrides:
+ if object.command == override.command:
+ exists = True
+ object.absolutePath = override.absolutePath
+ break
+ if not exists:
+ self.overrides.append(override)
def _setStartingDay(self, value):
"""
Modified: cedar-backup2/trunk/test/configtests.py
===================================================================
--- cedar-backup2/trunk/test/configtests.py 2010-01-10 23:24:37 UTC (rev 962)
+++ cedar-backup2/trunk/test/configtests.py 2010-01-10 23:57:16 UTC (rev 963)
@@ -6040,7 +6040,6 @@
Test addOverride() with no existing overrides.
"""
options = OptionsConfig();
- options.overrides = []
options.addOverride("cdrecord", "/usr/bin/wodim")
self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
@@ -6067,7 +6066,6 @@
Test replaceOverride() with no existing overrides.
"""
options = OptionsConfig();
- options.overrides = []
options.replaceOverride("cdrecord", "/usr/bin/wodim")
self.failUnlessEqual([ CommandOverride("cdrecord", "/usr/bin/wodim"), ], options.overrides);
Modified: cedar-backup2/trunk/test/customizetests.py
===================================================================
--- cedar-backup2/trunk/test/customizetests.py 2010-01-10 23:24:37 UTC (rev 962)
+++ cedar-backup2/trunk/test/customizetests.py 2010-01-10 23:57:16 UTC (rev 963)
@@ -77,14 +77,13 @@
"""
config = Config()
options = OptionsConfig();
- options.overrides = []
if PLATFORM == "standard":
config.options = options
customizeOverrides(config)
- self.failUnlessEqual([], options.overrides);
+ self.failUnlessEqual(None, options.overrides);
config.options = options
customizeOverrides(config, platform="standard")
- self.failUnlessEqual([], options.overrides);
+ self.failUnlessEqual(None, options.overrides);
def testCustomizeOverrides_002(self):
"""
@@ -137,7 +136,6 @@
"""
config = Config()
options = OptionsConfig();
- options.overrides = []
if PLATFORM == "debian":
config.options = options
customizeOverrides(config)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-02-23 22:30:01
|
Revision: 966
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=966&view=rev
Author: pronovic
Date: 2010-02-23 22:29:55 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
Work around strange stderr file descriptor bugs discovered on Cygwin.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-01-10 23:59:25 UTC (rev 965)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-02-23 22:29:55 UTC (rev 966)
@@ -1535,7 +1535,13 @@
fields.extend(args)
try:
sanitizeEnvironment() # make sure we have a consistent environment
- pipe = Pipe(fields, ignoreStderr=ignoreStderr)
+ try:
+ pipe = Pipe(fields, ignoreStderr=ignoreStderr)
+ except OSError:
+ # On some platforms (i.e. Cygwin) this intermittently fails the first time we do it.
+ # So, we attempt it a second time and if that works, we just go on as usual.
+ # The problem appears to be that we sometimes get a bad stderr file descriptor.
+ pipe = Pipe(fields, ignoreStderr=ignoreStderr)
while True:
line = pipe.fromchild.readline()
if not line: break
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-01-10 23:59:25 UTC (rev 965)
+++ cedar-backup2/trunk/Changelog 2010-02-23 22:29:55 UTC (rev 966)
@@ -1,3 +1,7 @@
+Version 2.19.6 unreleased
+
+ * Work around strange stderr file descriptor bugs discovered on Cygwin.
+
Version 2.19.5 10 Jan 2010
* Add customization support, so Debian can use wodim and genisoimage.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-02-23 22:47:28
|
Revision: 967
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=967&view=rev
Author: pronovic
Date: 2010-02-23 22:47:22 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
Tweak expected results for tests that fail on Cygwin with Python 2.5.x.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/test/filesystemtests.py
cedar-backup2/trunk/test/peertests.py
cedar-backup2/trunk/test/utiltests.py
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2010-02-23 22:29:55 UTC (rev 966)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2010-02-23 22:47:22 UTC (rev 967)
@@ -387,6 +387,8 @@
return platform.platform(True, True).startswith("Windows")
elif name == "macosx":
return sys.platform == "darwin"
+ elif name == "cygwin":
+ return platform.platform(True, True).startswith("CYGWIN")
else:
raise ValueError("Unknown platform [%s]." % name)
@@ -413,6 +415,17 @@
return _isPlatform("windows")
+############################
+# platformCygwin() function
+############################
+
+def platformCygwin():
+ """
+ Returns boolean indicating whether this is the Cygwin platform.
+ """
+ return _isPlatform("cygwin")
+
+
###################################
# platformSupportsLinks() function
###################################
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-02-23 22:29:55 UTC (rev 966)
+++ cedar-backup2/trunk/Changelog 2010-02-23 22:47:22 UTC (rev 967)
@@ -1,6 +1,7 @@
Version 2.19.6 unreleased
* Work around strange stderr file descriptor bugs discovered on Cygwin.
+ * Tweak expected results for tests that fail on Cygwin with Python 2.5.x.
Version 2.19.5 10 Jan 2010
Modified: cedar-backup2/trunk/test/filesystemtests.py
===================================================================
--- cedar-backup2/trunk/test/filesystemtests.py 2010-02-23 22:29:55 UTC (rev 966)
+++ cedar-backup2/trunk/test/filesystemtests.py 2010-02-23 22:47:22 UTC (rev 967)
@@ -118,7 +118,8 @@
import tarfile
from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar, changeFileAge, randomFilename
-from CedarBackup2.testutil import platformMacOsX, platformWindows, platformSupportsLinks, platformRequiresBinaryRead
+from CedarBackup2.testutil import platformMacOsX, platformWindows, platformCygwin
+from CedarBackup2.testutil import platformSupportsLinks, platformRequiresBinaryRead
from CedarBackup2.testutil import failUnlessAssignRaises
from CedarBackup2.filesystem import FilesystemList, BackupFileList, PurgeItemList, normalizeDir, compareContents
@@ -17902,7 +17903,10 @@
self.failUnless(self.buildPath([ "tree9", "file002", ]) in backupList)
self.failUnless(self.buildPath([ "tree9", "link001", ]) in backupList)
self.failUnless(self.buildPath([ "tree9", "link002", ]) in backupList)
- tarPath = self.buildRandomPath(260, ".tar")
+ if platformCygwin():
+ tarPath = self.buildRandomPath(255, ".tar") # Cygwin inherits the Windows 255-char limit
+ else:
+ tarPath = self.buildRandomPath(260, ".tar")
backupList.generateTarfile(tarPath, mode="tar")
self.failUnless(tarfile.is_tarfile(tarPath))
tarFile = tarfile.open(tarPath)
@@ -17981,7 +17985,10 @@
self.failUnless(self.buildPath([ "tree9", "file002", ]) in backupList)
self.failUnless(self.buildPath([ "tree9", "link001", ]) in backupList)
self.failUnless(self.buildPath([ "tree9", "link002", ]) in backupList)
- tarPath = self.buildRandomPath(260, ".tar.gz")
+ if platformCygwin():
+ tarPath = self.buildRandomPath(255, ".tar") # Cygwin inherits the Windows 255-char limit
+ else:
+ tarPath = self.buildRandomPath(260, ".tar")
backupList.generateTarfile(tarPath, mode="targz")
self.failUnless(tarfile.is_tarfile(tarPath))
tarFile = tarfile.open(tarPath)
@@ -18060,7 +18067,10 @@
self.failUnless(self.buildPath([ "tree9", "file002", ]) in backupList)
self.failUnless(self.buildPath([ "tree9", "link001", ]) in backupList)
self.failUnless(self.buildPath([ "tree9", "link002", ]) in backupList)
- tarPath = self.buildRandomPath(260, ".tar.bz2")
+ if platformCygwin():
+ tarPath = self.buildRandomPath(255, ".tar") # Cygwin inherits the Windows 255-char limit
+ else:
+ tarPath = self.buildRandomPath(260, ".tar")
backupList.generateTarfile(tarPath, mode="tarbz2")
self.failUnless(tarfile.is_tarfile(tarPath))
tarFile = tarfile.open(tarPath)
Modified: cedar-backup2/trunk/test/peertests.py
===================================================================
--- cedar-backup2/trunk/test/peertests.py 2010-02-23 22:29:55 UTC (rev 966)
+++ cedar-backup2/trunk/test/peertests.py 2010-02-23 22:47:22 UTC (rev 967)
@@ -100,7 +100,7 @@
import getpass
from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar
from CedarBackup2.testutil import getMaskAsMode, getLogin, runningAsRoot, failUnlessAssignRaises
-from CedarBackup2.testutil import platformSupportsPermissions, platformWindows
+from CedarBackup2.testutil import platformSupportsPermissions, platformWindows, platformCygwin
from CedarBackup2.peer import LocalPeer, RemotePeer
from CedarBackup2.peer import DEF_RCP_COMMAND, DEF_RSH_COMMAND
from CedarBackup2.peer import DEF_COLLECT_INDICATOR, DEF_STAGE_INDICATOR
@@ -345,7 +345,7 @@
with spaces in the collect directory path and collect indicator file name.
"""
name = "peer1"
- if platformWindows():
+ if platformWindows() or platformCygwin():
# os.listdir has problems with trailing spaces
collectDir = self.buildPath([" collect dir", ])
collectIndicator = self.buildPath([" collect dir", "different, file", ])
Modified: cedar-backup2/trunk/test/utiltests.py
===================================================================
--- cedar-backup2/trunk/test/utiltests.py 2010-02-23 22:29:55 UTC (rev 966)
+++ cedar-backup2/trunk/test/utiltests.py 2010-02-23 22:47:22 UTC (rev 967)
@@ -83,7 +83,7 @@
from os.path import isdir
from CedarBackup2.testutil import findResources, removedir, extractTar, buildPath, captureOutput
-from CedarBackup2.testutil import platformHasEcho, platformWindows, platformSupportsLinks
+from CedarBackup2.testutil import platformHasEcho, platformWindows, platformCygwin, platformSupportsLinks
from CedarBackup2.util import UnorderedList, AbsolutePathList, ObjectTypeList
from CedarBackup2.util import RestrictedContentList, RegexMatchList, RegexList
from CedarBackup2.util import DirectedGraph, PathResolverSingleton, Diagnostics
@@ -3370,7 +3370,7 @@
seems to result in the exact same file on disk, so the test is valid.
"""
encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
- if encoding != 'mbcs' and encoding.find("ANSI") != 0: # test can't work on some filesystems
+ if not platformCygwin() and encoding != 'mbcs' and encoding.find("ANSI") != 0: # test can't work on some filesystems
path = u"\xe2\x99\xaa\xe2\x99\xac"
safePath = encodePath(path)
self.failUnless(isinstance(safePath, str))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-05-22 16:26:02
|
Revision: 969
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=969&view=rev
Author: pronovic
Date: 2010-05-22 16:25:56 +0000 (Sat, 22 May 2010)
Log Message:
-----------
Set up command overrides properly so full test suite works on Debian
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/util/test.py
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2010-05-22 16:14:52 UTC (rev 968)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2010-05-22 16:25:56 UTC (rev 969)
@@ -52,8 +52,8 @@
@sort: findResources, commandAvailable,
buildPath, removedir, extractTar, changeFileAge,
getMaskAsMode, getLogin, failUnlessAssignRaises, runningAsRoot,
- platformMacOsX, platformWindows, platformHasEcho,
- platformSupportsLinks, platformSupportsPermissions,
+ platformDebian, platformMacOsX, platformCygwin, platformWindows,
+ platformHasEcho, platformSupportsLinks, platformSupportsPermissions,
platformRequiresBinaryRead
@author: Kenneth J. Pronovici <pro...@ie...>
@@ -76,6 +76,9 @@
from StringIO import StringIO
from CedarBackup2.util import encodePath, executeCommand
+from CedarBackup2.config import Config, OptionsConfig
+from CedarBackup2.customize import customizeOverrides
+from CedarBackup2.cli import setupPathResolver
########################################################################
@@ -105,6 +108,33 @@
logger.addHandler(handler)
+#################
+# setupOverrides
+#################
+
+def setupOverrides():
+ """
+ Set up any platform-specific overrides that might be required.
+
+ When packages are built, this is done manually (hardcoded) in customize.py
+ and the overrides are set up in cli.cli(). This way, no runtime checks need
+ to be done. This is safe, because the package maintainer knows exactly
+ which platform (Debian or not) the package is being built for.
+
+ Unit tests are different, because they might be run anywhere. So, we
+ attempt to make a guess about plaform using platformDebian(), and use that
+ to set up the custom overrides so that platform-specific unit tests continue
+ to work.
+ """
+ config = Config()
+ config.options = OptionsConfig()
+ if platformDebian():
+ customizeOverrides(config, platform="debian")
+ else:
+ customizeOverrides(config, platform="standard")
+ setupPathResolver(config)
+
+
###########################
# findResources() function
###########################
@@ -387,6 +417,8 @@
return platform.platform(True, True).startswith("Windows")
elif name == "macosx":
return sys.platform == "darwin"
+ elif name == "debian":
+ return platform.platform(False, False).find("debian") > 0
elif name == "cygwin":
return platform.platform(True, True).startswith("CYGWIN")
else:
@@ -394,6 +426,17 @@
############################
+# platformDebian() function
+############################
+
+def platformDebian():
+ """
+ Returns boolean indicating whether this is the Debian platform.
+ """
+ return _isPlatform("debian")
+
+
+############################
# platformMacOsX() function
############################
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-05-22 16:14:52 UTC (rev 968)
+++ cedar-backup2/trunk/Changelog 2010-05-22 16:25:56 UTC (rev 969)
@@ -2,6 +2,7 @@
* Work around strange stderr file descriptor bugs discovered on Cygwin.
* Tweak expected results for tests that fail on Cygwin with Python 2.5.x.
+ * Set up command overrides properly so full test suite works on Debian.
Version 2.19.5 10 Jan 2010
Modified: cedar-backup2/trunk/util/test.py
===================================================================
--- cedar-backup2/trunk/util/test.py 2010-05-22 16:14:52 UTC (rev 968)
+++ cedar-backup2/trunk/util/test.py 2010-05-22 16:25:56 UTC (rev 969)
@@ -134,6 +134,10 @@
print "tree, or properly set the PYTHONPATH enviroment variable."
return 1
+ # Setup platform-specific command overrides
+ from CedarBackup2.testutil import setupOverrides
+ setupOverrides()
+
# Import the unit test modules
try:
if os.path.exists(os.path.join(".", "test", "filesystemtests.py")):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-05-22 16:37:46
|
Revision: 970
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=970&view=rev
Author: pronovic
Date: 2010-05-22 16:37:38 +0000 (Sat, 22 May 2010)
Log Message:
-----------
Add refresh_media_delay configuration option and related functionality.
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/util.py
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/manual/src/config.xml
cedar-backup2/trunk/test/configtests.py
cedar-backup2/trunk/test/data/cback.conf.12
Property Changed:
----------------
cedar-backup2/trunk/
Property changes on: cedar-backup2/trunk
___________________________________________________________________
Added: svn:ignore
+ tags
Modified: cedar-backup2/trunk/CedarBackup2/actions/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/CedarBackup2/actions/util.py 2010-05-22 16:37:38 UTC (rev 970)
@@ -147,14 +147,15 @@
deviceScsiId = config.store.deviceScsiId
driveSpeed = config.store.driveSpeed
noEject = config.store.noEject
+ refreshMediaDelay = config.store.refreshMediaDelay
deviceType = _getDeviceType(config)
mediaType = _getMediaType(config)
if deviceMounted(devicePath):
raise IOError("Device [%s] is currently mounted." % (devicePath))
if deviceType == "cdwriter":
- return CdWriter(devicePath, deviceScsiId, driveSpeed, mediaType, noEject)
+ return CdWriter(devicePath, deviceScsiId, driveSpeed, mediaType, noEject, refreshMediaDelay)
elif deviceType == "dvdwriter":
- return DvdWriter(devicePath, deviceScsiId, driveSpeed, mediaType, noEject)
+ return DvdWriter(devicePath, deviceScsiId, driveSpeed, mediaType, noEject, refreshMediaDelay)
else:
raise ValueError("Device type [%s] is invalid." % deviceType)
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-05-22 16:37:38 UTC (rev 970)
@@ -3490,6 +3490,7 @@
- The SCSI id, if provided, must be in the form specified by L{validateScsiId}.
- The drive speed must be an integer >= 1
- The blanking behavior must be a C{BlankBehavior} object
+ - The refresh media delay must be an integer >= 0
Note that although the blanking factor must be a positive floating point
number, it is stored as a string. This is done so that we can losslessly go
@@ -3497,13 +3498,14 @@
@sort: __init__, __repr__, __str__, __cmp__, sourceDir,
mediaType, deviceType, devicePath, deviceScsiId,
- driveSpeed, checkData, checkMedia, warnMidnite, noEject, blankBehavior
+ driveSpeed, checkData, checkMedia, warnMidnite, noEject,
+ blankBehavior, refreshMediaDelay
"""
def __init__(self, sourceDir=None, mediaType=None, deviceType=None,
devicePath=None, deviceScsiId=None, driveSpeed=None,
checkData=False, warnMidnite=False, noEject=False,
- checkMedia=False, blankBehavior=None):
+ checkMedia=False, blankBehavior=None, refreshMediaDelay=None):
"""
Constructor for the C{StoreConfig} class.
@@ -3518,6 +3520,7 @@
@param warnMidnite: Whether to generate warnings for crossing midnite.
@param noEject: Indicates that the writer device should not be ejected.
@param blankBehavior: Controls optimized blanking behavior.
+ @param refreshMediaDelay: Delay, in seconds, to add after refreshing media
@raise ValueError: If one of the values is invalid.
"""
@@ -3532,6 +3535,7 @@
self._warnMidnite = None
self._noEject = None
self._blankBehavior = None
+ self._refreshMediaDelay = None
self.sourceDir = sourceDir
self.mediaType = mediaType
self.deviceType = deviceType
@@ -3543,15 +3547,16 @@
self.warnMidnite = warnMidnite
self.noEject = noEject
self.blankBehavior = blankBehavior
+ self.refreshMediaDelay = refreshMediaDelay
def __repr__(self):
"""
Official string representation for class instance.
"""
- return "StoreConfig(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.sourceDir, self.mediaType, self.deviceType,
- self.devicePath, self.deviceScsiId, self.driveSpeed,
- self.checkData, self.warnMidnite, self.noEject,
- self.checkMedia, self.blankBehavior)
+ return "StoreConfig(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.sourceDir, self.mediaType, self.deviceType,
+ self.devicePath, self.deviceScsiId, self.driveSpeed,
+ self.checkData, self.warnMidnite, self.noEject,
+ self.checkMedia, self.blankBehavior, self.refreshMediaDelay)
def __str__(self):
"""
@@ -3622,6 +3627,11 @@
return -1
else:
return 1
+ if self._refreshMediaDelay != other._refreshMediaDelay:
+ if self._refreshMediaDelay < other._refreshMediaDelay:
+ return -1
+ else:
+ return 1
return 0
def _setSourceDir(self, value):
@@ -3810,6 +3820,31 @@
"""
return self._blankBehavior
+ def _setRefreshMediaDelay(self, value):
+ """
+ Property target used to set the refreshMediaDelay.
+ The value must be an integer >= 0.
+ @raise ValueError: If the value is not valid.
+ """
+ if value is None:
+ self._refreshMediaDelay = None
+ else:
+ try:
+ value = int(value)
+ except TypeError:
+ raise ValueError("Action refreshMediaDelay value must be an integer >= 0.")
+ if value < 0:
+ raise ValueError("Action refreshMediaDelay value must be an integer >= 0.")
+ if value == 0:
+ value = None # normalize this out, since it's the default
+ self._refreshMediaDelay = value
+
+ def _getRefreshMediaDelay(self):
+ """
+ Property target used to get the action refreshMediaDelay.
+ """
+ return self._refreshMediaDelay
+
sourceDir = property(_getSourceDir, _setSourceDir, None, "Directory whose contents should be written to media.")
mediaType = property(_getMediaType, _setMediaType, None, "Type of the media (see notes above).")
deviceType = property(_getDeviceType, _setDeviceType, None, "Type of the device (optional, see notes above).")
@@ -3821,6 +3856,7 @@
warnMidnite = property(_getWarnMidnite, _setWarnMidnite, None, "Whether to generate warnings for crossing midnite.")
noEject = property(_getNoEject, _setNoEject, None, "Indicates that the writer device should not be ejected.")
blankBehavior = property(_getBlankBehavior, _setBlankBehavior, None, "Controls optimized blanking behavior.")
+ refreshMediaDelay = property(_getRefreshMediaDelay, _setRefreshMediaDelay, None, "Delay, in seconds, to add after refreshing media.")
########################################################################
@@ -4635,6 +4671,7 @@
store.warnMidnite = readBoolean(sectionNode, "warn_midnite")
store.noEject = readBoolean(sectionNode, "no_eject")
store.blankBehavior = Config._parseBlankBehavior(sectionNode)
+ store.refreshMediaDelay = readInteger(sectionNode, "refresh_media_delay")
return store
_parseStore = staticmethod(_parseStore)
@@ -5325,6 +5362,7 @@
addBooleanNode(xmlDom, sectionNode, "check_media", storeConfig.checkMedia)
addBooleanNode(xmlDom, sectionNode, "warn_midnite", storeConfig.warnMidnite)
addBooleanNode(xmlDom, sectionNode, "no_eject", storeConfig.noEject)
+ addIntegerNode(xmlDom, sectionNode, "refresh_media_delay", storeConfig.refreshMediaDelay)
Config._addBlankBehavior(xmlDom, sectionNode, storeConfig.blankBehavior)
_addStore = staticmethod(_addStore)
Modified: cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-05-22 16:37:38 UTC (rev 970)
@@ -413,7 +413,8 @@
##############
def __init__(self, device, scsiId=None, driveSpeed=None,
- mediaType=MEDIA_CDRW_74, noEject=False, unittest=False):
+ mediaType=MEDIA_CDRW_74, noEject=False,
+ refreshMediaDelay=0, unittest=False):
"""
Initializes a CD writer object.
@@ -454,6 +455,9 @@
@param noEject: Overrides properties to indicate that the device does not support eject.
@type noEject: Boolean true/false
+ @param refreshMediaDelay: Refresh media delay to use, if any
+ @type refreshMediaDelay: Number of seconds, an integer >= 0
+
@param unittest: Turns off certain validations, for use in unit testing.
@type unittest: Boolean true/false
@@ -468,6 +472,7 @@
self._driveSpeed = validateDriveSpeed(driveSpeed)
self._media = MediaDefinition(mediaType)
self._noEject = noEject
+ self._refreshMediaDelay = refreshMediaDelay
if not unittest:
(self._deviceType,
self._deviceVendor,
@@ -556,6 +561,12 @@
"""
return self._deviceCanEject
+ def _getRefreshMediaDelay(self):
+ """
+ Property target used to get the configured refresh media delay, in seconds.
+ """
+ return self._refreshMediaDelay
+
device = property(_getDevice, None, None, doc="Filesystem device name for this writer.")
scsiId = property(_getScsiId, None, None, doc="SCSI id for the device, in the form C{[<method>:]scsibus,target,lun}.")
hardwareId = property(_getHardwareId, None, None, doc="Hardware id for this writer, either SCSI id or device path.");
@@ -568,6 +579,7 @@
deviceSupportsMulti = property(_getDeviceSupportsMulti, None, None, doc="Indicates whether device supports multisession discs.")
deviceHasTray = property(_getDeviceHasTray, None, None, doc="Indicates whether the device has a media tray.")
deviceCanEject = property(_getDeviceCanEject, None, None, doc="Indicates whether the device supports ejecting its media.")
+ refreshMediaDelay = property(_getRefreshMediaDelay, None, None, doc="Refresh media delay, in seconds.")
#################################################
@@ -835,18 +847,24 @@
Sometimes, a device gets confused about the state of its media. Often,
all it takes to solve the problem is to eject the media and then
- immediately reload it.
+ immediately reload it. (There is also a configurable refresh media delay
+ which can be applied after the tray is closed, for situations where this
+ makes a difference.)
This only works if the device has a tray and supports ejecting its media.
We have no way to know if the tray is currently open or closed, so we
just send the appropriate command and hope for the best. If the device
does not have a tray or does not support ejecting its media, then we do
- nothing.
+ nothing. The configured delay still applies, though.
@raise IOError: If there is an error talking to the device.
"""
self.openTray()
self.closeTray()
+ if self.refreshMediaDelay is not None:
+ logger.debug("Per configuration, sleeping %d seconds to stabilize media state.")
+ time.sleep(self.refreshMediaDelay)
+ logger.debug("Sleep is complete; hopefully media state is stable now.")
def writeImage(self, imagePath=None, newDisc=False, writeMulti=True):
"""
Modified: cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/CedarBackup2/writers/dvdwriter.py 2010-05-22 16:37:38 UTC (rev 970)
@@ -57,6 +57,7 @@
import re
import logging
import tempfile
+import time
# Cedar Backup modules
from CedarBackup2.filesystem import BackupFileList
@@ -361,7 +362,8 @@
##############
def __init__(self, device, scsiId=None, driveSpeed=None,
- mediaType=MEDIA_DVDPLUSRW, noEject=False, unittest=False):
+ mediaType=MEDIA_DVDPLUSRW, noEject=False,
+ refreshMediaDelay=0, unittest=False):
"""
Initializes a DVD writer object.
@@ -394,6 +396,9 @@
@param noEject: Tells Cedar Backup that the device cannot safely be ejected
@type noEject: Boolean true/false
+ @param refreshMediaDelay: Refresh media delay to use, if any
+ @type refreshMediaDelay: Number of seconds, an integer >= 0
+
@param unittest: Turns off certain validations, for use in unit testing.
@type unittest: Boolean true/false
@@ -408,6 +413,7 @@
self._scsiId = scsiId # not validated, because it's just for reference
self._driveSpeed = validateDriveSpeed(driveSpeed)
self._media = MediaDefinition(mediaType)
+ self._refreshMediaDelay = refreshMediaDelay
if noEject:
self._deviceHasTray = False
self._deviceCanEject = False
@@ -462,6 +468,12 @@
"""
return self._deviceCanEject
+ def _getRefreshMediaDelay(self):
+ """
+ Property target used to get the configured refresh media delay, in seconds.
+ """
+ return self._refreshMediaDelay
+
device = property(_getDevice, None, None, doc="Filesystem device name for this writer.")
scsiId = property(_getScsiId, None, None, doc="SCSI id for the device (saved for reference only).")
hardwareId = property(_getHardwareId, None, None, doc="Hardware id for this writer (always the device path).");
@@ -469,6 +481,7 @@
media = property(_getMedia, None, None, doc="Definition of media that is expected to be in the device.")
deviceHasTray = property(_getDeviceHasTray, None, None, doc="Indicates whether the device has a media tray.")
deviceCanEject = property(_getDeviceCanEject, None, None, doc="Indicates whether the device supports ejecting its media.")
+ refreshMediaDelay = property(_getRefreshMediaDelay, None, None, doc="Refresh media delay, in seconds.")
#################################################
@@ -635,18 +648,24 @@
Sometimes, a device gets confused about the state of its media. Often,
all it takes to solve the problem is to eject the media and then
- immediately reload it.
+ immediately reload it. (There is also a configurable refresh media delay
+ which can be applied after the tray is closed, for situations where this
+ makes a difference.)
This only works if the device has a tray and supports ejecting its media.
We have no way to know if the tray is currently open or closed, so we
just send the appropriate command and hope for the best. If the device
does not have a tray or does not support ejecting its media, then we do
- nothing.
+ nothing. The configured delay still applies, though.
@raise IOError: If there is an error talking to the device.
"""
self.openTray()
self.closeTray()
+ if self.refreshMediaDelay is not None:
+ logger.debug("Per configuration, sleeping %d seconds to stabilize media state.")
+ time.sleep(self.refreshMediaDelay)
+ logger.debug("Sleep is complete; hopefully media state is stable now.")
def writeImage(self, imagePath=None, newDisc=False, writeMulti=True):
"""
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/Changelog 2010-05-22 16:37:38 UTC (rev 970)
@@ -3,6 +3,7 @@
* Work around strange stderr file descriptor bugs discovered on Cygwin.
* Tweak expected results for tests that fail on Cygwin with Python 2.5.x.
* Set up command overrides properly so full test suite works on Debian.
+ * Add refresh_media_delay configuration option and related functionality.
Version 2.19.5 10 Jan 2010
Modified: cedar-backup2/trunk/manual/src/config.xml
===================================================================
--- cedar-backup2/trunk/manual/src/config.xml 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/manual/src/config.xml 2010-05-22 16:37:38 UTC (rev 970)
@@ -2198,6 +2198,7 @@
<check_media>Y</check_media>
<warn_midnite>Y</warn_midnite>
<no_eject>N</no_eject>
+ <refresh_media_delay>5</refresh_media_delay>
<blank_behavior>
<mode>weekly</mode>
<factor>1.3</factor>
@@ -2497,6 +2498,27 @@
</varlistentry>
<varlistentry>
+ <term><literal>refresh_media_delay</literal></term>
+ <listitem>
+ <para>Number of seconds to delay after refreshing media</para>
+ <para>
+ This field is optional. If it doesn't exist, no delay
+ will occur.
+ </para>
+ <para>
+ Some devices seem to take a little while to stablize after
+ refreshing the media (i.e. closing and opening the tray).
+ During this period, operations on the media may fail. If
+ your device behaves like this, you can try setting a delay
+ of a few seconds to remedy the problem.
+ </para>
+ <para>
+ <emphasis>Restrictions:</emphasis> If set, must be an integer ≥ 1.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>blank_behavior</literal></term>
<listitem>
<para>Optimized blanking strategy.</para>
Modified: cedar-backup2/trunk/test/configtests.py
===================================================================
--- cedar-backup2/trunk/test/configtests.py 2010-05-22 16:25:56 UTC (rev 969)
+++ cedar-backup2/trunk/test/configtests.py 2010-05-22 16:37:38 UTC (rev 970)
@@ -7794,13 +7794,14 @@
self.failUnlessEqual(False, store.warnMidnite)
self.failUnlessEqual(False, store.noEject)
self.failUnlessEqual(None, store.blankBehavior)
+ self.failUnlessEqual(None, store.refreshMediaDelay)
def testConstructor_002(self):
"""
Test constructor with all values filled in, with valid values.
"""
behavior = BlankBehavior("weekly", "1.3")
- store = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior)
+ store = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior, 12)
self.failUnlessEqual("/source", store.sourceDir)
self.failUnlessEqual("cdr-74", store.mediaType)
self.failUnlessEqual("cdwriter", store.deviceType)
@@ -7812,6 +7813,7 @@
self.failUnlessEqual(True, store.warnMidnite)
self.failUnlessEqual(True, store.noEject)
self.failUnlessEqual(behavior, store.blankBehavior)
+ self.failUnlessEqual(12, store.refreshMediaDelay)
def testConstructor_003(self):
"""
@@ -8213,7 +8215,43 @@
store = StoreConfig()
self.failUnlessAssignRaises(ValueError, store, "blankBehavior", CollectDir())
+ def testConstructor_041(self):
+ """
+ Test assignment of refreshMediaDelay attribute, None value.
+ """
+ store = StoreConfig(refreshMediaDelay=4)
+ self.failUnlessEqual(4, store.refreshMediaDelay)
+ store.refreshMediaDelay = None
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+ def testConstructor_042(self):
+ """
+ Test assignment of refreshMediaDelay attribute, valid value.
+ """
+ store = StoreConfig()
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+ store.refreshMediaDelay = 4
+ self.failUnlessEqual(4, store.refreshMediaDelay)
+ store.refreshMediaDelay = "12"
+ self.failUnlessEqual(12, store.refreshMediaDelay)
+ store.refreshMediaDelay = "0"
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+ store.refreshMediaDelay = 0
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+
+ def testConstructor_043(self):
+ """
+ Test assignment of refreshMediaDelay attribute, invalid value (not an integer).
+ """
+ store = StoreConfig()
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+ self.failUnlessAssignRaises(ValueError, store, "refreshMediaDelay", "blech")
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+ self.failUnlessAssignRaises(ValueError, store, "refreshMediaDelay", CollectDir())
+ self.failUnlessEqual(None, store.refreshMediaDelay)
+
+
+
############################
# Test comparison operators
############################
@@ -8238,8 +8276,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failUnlessEqual(store1, store2)
self.failUnless(store1 == store2)
self.failUnless(not store1 < store2)
@@ -8268,8 +8306,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source1", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1)
- store2 = StoreConfig("/source2", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source1", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source2", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8298,8 +8336,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdrw-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdrw-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(not store1 < store2)
@@ -8342,8 +8380,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/hdd", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/hdd", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8372,8 +8410,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "ATA:0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "ATA:0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8402,8 +8440,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 1, True, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 1, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8418,8 +8456,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, False, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, False, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8434,8 +8472,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, False, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, False, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8450,8 +8488,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, False, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, False, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8466,8 +8504,8 @@
"""
behavior1 = BlankBehavior("weekly", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, False, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, False, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8497,8 +8535,8 @@
"""
behavior1 = BlankBehavior("daily", "1.3")
behavior2 = BlankBehavior("weekly", "1.3")
- store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1)
- store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2)
+ store1 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior1, 4)
+ store2 = StoreConfig("/source", "cdr-74", "cdwriter", "/dev/cdrw", "0,0,0", 4, True, True, True, True, behavior2, 4)
self.failIfEqual(store1, store2)
self.failUnless(not store1 == store2)
self.failUnless(store1 < store2)
@@ -8507,7 +8545,37 @@
self.failUnless(not store1 >= store2)
self.failUnless(store1 != store2)
+ def testComparison_020(self):
+ """
+ Test comparison of two differing objects, refreshM...
[truncated message content] |
|
From: <pro...@us...> - 2010-05-22 17:01:03
|
Revision: 973
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=973&view=rev
Author: pronovic
Date: 2010-05-22 17:00:56 +0000 (Sat, 22 May 2010)
Log Message:
-----------
Release 2.19.6
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2010-05-22 16:51:20 UTC (rev 972)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2010-05-22 17:00:56 UTC (rev 973)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2010"
-VERSION = "2.19.5"
-DATE = "10 Jan 2010"
+VERSION = "2.19.6"
+DATE = "22 May 2010"
URL = "http://cedar-backup.sourceforge.net/"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-05-22 16:51:20 UTC (rev 972)
+++ cedar-backup2/trunk/Changelog 2010-05-22 17:00:56 UTC (rev 973)
@@ -1,4 +1,4 @@
-Version 2.19.6 unreleased
+Version 2.19.6 22 May 2010
* Work around strange stderr file descriptor bugs discovered on Cygwin.
* Tweak expected results for tests that fail on Cygwin with Python 2.5.x.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2010-06-30 01:19:50
|
Revision: 978
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=978&view=rev
Author: pronovic
Date: 2010-06-30 01:19:43 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Fix minor pychecker warnings
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/config.py
cedar-backup2/trunk/CedarBackup2/tools/span.py
cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/config.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/config.py 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/CedarBackup2/config.py 2010-06-30 01:19:43 UTC (rev 978)
@@ -2633,8 +2633,8 @@
self.overrides = [ override, ]
else:
exists = False
- for object in self.overrides:
- if object.command == override.command:
+ for obj in self.overrides:
+ if obj.command == override.command:
exists = True
break
if not exists:
@@ -2651,10 +2651,10 @@
self.overrides = [ override, ]
else:
exists = False
- for object in self.overrides:
- if object.command == override.command:
+ for obj in self.overrides:
+ if obj.command == override.command:
exists = True
- object.absolutePath = override.absolutePath
+ obj.absolutePath = override.absolutePath
break
if not exists:
self.overrides.append(override)
Modified: cedar-backup2/trunk/CedarBackup2/tools/span.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/CedarBackup2/tools/span.py 2010-06-30 01:19:43 UTC (rev 978)
@@ -495,7 +495,7 @@
"""
print ""
_discInitializeImage(config, writer, spanItem)
- _discWriteImage(config, writer, spanItem)
+ _discWriteImage(config, writer)
_discConsistencyCheck(config, writer, spanItem)
print "Write process is complete."
print "==="
@@ -526,12 +526,11 @@
print "==="
print "Completed initializing image."
-def _discWriteImage(config, writer, spanItem):
+def _discWriteImage(config, writer):
"""
Writes a ISO image for a span item.
@param config: Cedar Backup configuration
@param writer: Writer to use
- @param spanItem: Span item to write
"""
complete = False
while not complete:
@@ -574,7 +573,7 @@
print "Ok, attempting retry."
_getReturn("Please replace the disc in your backup device.\nPress return when ready.")
print "==="
- _discWriteImage(config, writer, spanItem)
+ _discWriteImage(config, writer)
else:
print "Ok, attempting retry."
print "==="
Modified: cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/CedarBackup2/writers/cdwriter.py 2010-06-30 01:19:43 UTC (rev 978)
@@ -59,6 +59,7 @@
import re
import logging
import tempfile
+import time
# Cedar Backup modules
from CedarBackup2.filesystem import FilesystemList
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2010-06-04 00:50:25 UTC (rev 977)
+++ cedar-backup2/trunk/Changelog 2010-06-30 01:19:43 UTC (rev 978)
@@ -1,3 +1,7 @@
+Version 2.19.7 unreleased
+
+ * Fix minor Pychecker warnings.
+
Version 2.19.6 22 May 2010
* Work around strange stderr file descriptor bugs discovered on Cygwin.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|