From 5712d6c80f9be604abf2c293a86aedc8985d1916 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 4 Oct 2010 11:40:23 -0700 Subject: [PATCH] Bug #339642 - Make --sync try all addresses. --- cnf/make.conf | 4 +++- cnf/make.globals | 2 +- make.conf.txt | 2 +- man/make.conf.5 | 7 ++++--- pym/_emerge/actions.py | 5 ++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cnf/make.conf b/cnf/make.conf index b08e81cf4..8d07752f1 100644 --- a/cnf/make.conf +++ b/cnf/make.conf @@ -194,7 +194,9 @@ # PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve # a current portage tree before it exits with an error. This allows # for a more successful retrieval without user intervention most times. -#PORTAGE_RSYNC_RETRIES="3" +# If set to a negative number, then retry until all possible addresses are +# exhausted. +#PORTAGE_RSYNC_RETRIES="-1" # # PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync # command used by `emerge --sync`. This will not change the default options diff --git a/cnf/make.globals b/cnf/make.globals index 9ba10444b..39ea548b9 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -88,7 +88,7 @@ PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5" PORTAGE_FETCH_RESUME_MIN_SIZE="350K" # Number of times 'emerge --sync' will run before giving up. -PORTAGE_RSYNC_RETRIES="3" +PORTAGE_RSYNC_RETRIES="-1" # Number of seconds rsync will wait before timing out. #RSYNC_TIMEOUT="180" diff --git a/make.conf.txt b/make.conf.txt index 4531ed859..5bbb6e346 100644 --- a/make.conf.txt +++ b/make.conf.txt @@ -522,7 +522,7 @@ you know exactly what you're doing!** PORTAGE_RSYNC_RETRIES --------------------- -:default: 3 +:default: -1 :valdesc: integer The number of times rsync should retry on failed connections before giving up. diff --git a/man/make.conf.5 b/man/make.conf.5 index a55e7fc97..faab2b90b 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -1,4 +1,4 @@ -.TH "MAKE.CONF" "5" "Aug 2010" "Portage VERSION" "Portage" +.TH "MAKE.CONF" "5" "Oct 2010" "Portage VERSION" "Portage" .SH "NAME" make.conf \- custom settings for Portage .SH "SYNOPSIS" @@ -703,9 +703,10 @@ Defaults to "\-\-recursive \-\-links \-\-safe\-links \-\-perms \-\-times .TP \fBPORTAGE_RSYNC_RETRIES\fR = \fI[NUMBER]\fR The number of times rsync should retry on failed connections before -giving up. +giving up. If set to a negative number, then retry until all possible +addresses are exhausted. .br -Defaults to 3. +Defaults to -1. .TP \fBPORTAGE_SYNC_STALE\fR = \fI[NUMBER]\fR Defines the number of days after the last `emerge \-\-sync` that a warning diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index a5bb0e52c..6dad3785c 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2068,7 +2068,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): except SystemExit as e: raise # Needed else can't exit except: - maxretries=3 #default number of retries + maxretries = -1 #default number of retries retries=0 user_name, hostname, port = re.split( @@ -2264,9 +2264,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): retries=retries+1 - if retries<=maxretries: + if maxretries < 0 or retries <= maxretries: print(">>> Retrying...") - time.sleep(11) else: # over retries # exit loop -- 2.26.2