diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-05-28 07:32:25 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-05-28 07:32:25 +0000 |
commit | 7d9ec2790d9c89a3e111fc94b7fb4a4917f74c96 (patch) | |
tree | 43feb4e005547d4dbe201e451808739b52ed6d25 /bin | |
parent | fb26d97afdae5bf7f2252d5e9106dcb47ec72a08 (diff) | |
download | portage-7d9ec2790d9c89a3e111fc94b7fb4a4917f74c96.tar.gz portage-7d9ec2790d9c89a3e111fc94b7fb4a4917f74c96.tar.bz2 portage-7d9ec2790d9c89a3e111fc94b7fb4a4917f74c96.zip |
For bug #180009, add a PORTAGE_RSYNC_INITIAL_TIMEOUT config variable. The default is 15 seconds and it can be disabled by setting it to 0. (trunk r6650)
svn path=/main/branches/2.1.2/; revision=6651
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/emerge b/bin/emerge index eca2b24c1..7b5e6f378 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3945,6 +3945,12 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): del content try: + rsync_initial_timeout = \ + int(settings.get("PORTAGE_RSYNC_INITIAL_TIMEOUT", "15")) + except ValueError: + rsync_initial_timeout = 15 + + try: if settings.has_key("RSYNC_RETRIES"): print yellow("WARNING:")+" usage of RSYNC_RETRIES is deprecated, use PORTAGE_RSYNC_RETRIES instead" maxretries=int(settings["RSYNC_RETRIES"]) @@ -4054,14 +4060,16 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): # Timeout here in case the server is unresponsive. The # --timeout rsync option doesn't apply to the initial # connection attempt. - signal.alarm(15) + if rsync_initial_timeout: + signal.alarm(rsync_initial_timeout) try: mypids.extend(portage_exec.spawn( mycommand, env=settings.environ(), returnpid=True)) exitcode = os.waitpid(mypids[0], 0)[1] content = portage.grabfile(tmpservertimestampfile) finally: - signal.alarm(0) + if rsync_initial_timeout: + signal.alarm(0) try: os.unlink(tmpservertimestampfile) except OSError: |