Blob Blame History Raw
Patch by Robert Scheck <robert@fedoraproject.org> to get duplicity >= 0.4.11 building with
older Python 2.3 again. This release done by Kenneth Loafman <kenneth@loafman.com> luckily
got Python 2.3 support back. Second part of the patch replaces the use of functionality of
Python >= 2.4 functions. For further information, see:

 - http://lists.gnu.org/archive/html/duplicity-talk/2008-05/msg00036.html
 - https://bugzilla.redhat.com/show_bug.cgi?id=453069

--- duplicity-0.4.11/setup.py				2008-05-05 16:40:53.000000000 +0200
+++ duplicity-0.4.11/setup.py.python23			2008-05-05 21:45:35.000000000 +0200
@@ -5,8 +5,8 @@
 
 version_string = "0.4.11"
 
-if sys.version_info[:2] < (2,4):
-	print "Sorry, duplicity requires version 2.4 or later of python"
+if sys.version_info[:2] < (2,3):
+	print "Sorry, duplicity requires version 2.3 or later of python"
 	sys.exit(1)
 
 try:
--- duplicity-0.4.11/src/collections.py			2008-05-05 16:40:53.000000000 +0200
+++ duplicity-0.4.11/src/collections.py.python23	2008-06-28 10:53:35.000000000 +0200
@@ -789,6 +789,10 @@
 		NOTE: n = 1 -> time of latest available chain (n = 0 is not
 		a valid input). Thus the second-to-last is obtained with n=2
 		rather than n=1."""
+
+		def mycmp(x, y):
+			return cmp(x.get_first().time, y.get_first().time)
+
 		assert self.values_set
 		assert n > 0
 
@@ -796,9 +800,9 @@
 			return None
 
 		sorted = self.all_backup_chains[:]
-		sorted.sort(reverse = True,
-			    key = lambda chain: chain.get_first().time)
+		sorted.sort(mycmp)
 
+		sorted.reverse()
 		return sorted[n - 1]
 
 	def get_older_than(self, t):