Merged from trunk 6101:6104
authorFabian Groffen <grobian@gentoo.org>
Thu, 1 Mar 2007 16:42:13 +0000 (16:42 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 1 Mar 2007 16:42:13 +0000 (16:42 -0000)
For bug #168823, fix broken except statement syntax that prevents the
ValueError from being caught as intended.

For bug #168646, don't bail out immediately when rsync detects protocol
incompatibility (code 2) during fetching of the timestamp file.  Retry
for a better server (up to PORTAGE_RSYNC_RETRIES).

svn path=/main/branches/prefix/; revision=6106

pym/emerge/__init__.py
pym/portage/dbapi/vartree.py

index 6cab8ab9d96c7aecc7ca8226367b02f0082bfa1a..78350dfa98d3b867179890beca4000cb11c391a0 100644 (file)
@@ -4038,8 +4038,14 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                                env=settings.environ())
                                        if exitcode in [0,1,2,3,4,11,14,20,21]:
                                                break
-                       elif exitcode in [0,1,2,3,4,11,14,20,21]:
+                       elif exitcode in [1,3,4,11,14,20,21]:
                                break
+                       else:
+                               # Code 2 indicates protocol incompatibility, which is expected
+                               # for servers with protocol < 29 that don't support
+                               # --prune-empty-directories.  Retry for a server that supports
+                               # at least rsync protocol version 29 (>=rsync-2.6.7).
+                               pass
 
                        retries=retries+1
 
index 224da52977285e68a6ae4bd1ec5c45ae0ac78deb..d91fee247c998ae18d3a06a94bf4d9b56a5f313d 100644 (file)
@@ -67,7 +67,7 @@ class vardbapi(dbapi):
                "This method will grab the COUNTER. Returns a counter value."
                try:
                        return long(self.aux_get(mycpv, ["COUNTER"])[0])
-               except KeyError, ValueError:
+               except (KeyError, ValueError):
                        pass
                cdir = self.getpath(mycpv)
                cpath = self.getpath(mycpv, filename="COUNTER")