From c2f8e6fd15ddb5d56bf479452699b1046262587f Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Thu, 1 Mar 2007 16:42:13 +0000 Subject: [PATCH] Merged from trunk 6101:6104 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 | 8 +++++++- pym/portage/dbapi/vartree.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 6cab8ab9d..78350dfa9 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -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 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 224da5297..d91fee247 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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") -- 2.26.2