summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-02-10 01:53:56 +0000
committerZac Medico <zmedico@gentoo.org>2008-02-10 01:53:56 +0000
commit4839ec9fcd6e9bcab410854c340b19eed4fc030d (patch)
treebeae98d4959332fd595873b02b53bda9aa497022 /bin
parentf6658a7928a2a6e72ac08ef3b3f1028e6253a5fd (diff)
downloadportage-4839ec9fcd6e9bcab410854c340b19eed4fc030d.tar.gz
portage-4839ec9fcd6e9bcab410854c340b19eed4fc030d.tar.bz2
portage-4839ec9fcd6e9bcab410854c340b19eed4fc030d.zip
Fix the exitcode logic for bug #209144 so that when the server is
out of date it's not interpreted like an actual rsync exitcode (to avoid a misleading exitcode interpretation message). (trunk r9320) Bug #209144 - For emerge --sync, show an informative error and don't return 1 when PORTAGE_RSYNC_RETRIES is exceeded. (trunk r9321) svn path=/main/branches/2.1.2/; revision=9322
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge11
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/emerge b/bin/emerge
index 89a048a2a..6482bfb25 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -5154,6 +5154,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
("-6" in all_rsync_opts or "--ipv6" in all_rsync_opts):
family = socket.AF_INET6
ips=[]
+ SERVER_OUT_OF_DATE = -1
+ EXCEEDED_MAX_RETRIES = -2
while (1):
if ips:
del ips[0]
@@ -5296,7 +5298,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
print ">>> In order to force sync, remove '%s'." % servertimestampfile
print ">>>"
print
- exitcode = 1
+ exitcode = SERVER_OUT_OF_DATE
elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
# actual sync
mycommand = rsynccommand + [dosyncuri+"/", myportdir]
@@ -5322,10 +5324,17 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
# over retries
# exit loop
updatecache_flg=False
+ exitcode = EXCEEDED_MAX_RETRIES
break
if (exitcode==0):
emergelog(xterm_titles, "=== Sync completed with %s" % dosyncuri)
+ elif exitcode == SERVER_OUT_OF_DATE:
+ sys.exit(1)
+ elif exitcode == EXCEEDED_MAX_RETRIES:
+ sys.stderr.write(
+ ">>> Exceeded PORTAGE_RSYNC_RETRIES: %s\n" % maxretries)
+ sys.exit(1)
elif (exitcode>0):
print
if exitcode==1: