summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-28 07:28:48 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-28 07:28:48 +0000
commitf2a8756b2e5fd201582276fe45855dad237cd9aa (patch)
tree830b9088ffeb8af5f1051418e0f1689cf450869c /pym
parent678e85170599366dd26e00fa1d55e405b173fde6 (diff)
downloadportage-f2a8756b2e5fd201582276fe45855dad237cd9aa.tar.gz
portage-f2a8756b2e5fd201582276fe45855dad237cd9aa.tar.bz2
portage-f2a8756b2e5fd201582276fe45855dad237cd9aa.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.
svn path=/main/trunk/; revision=6650
Diffstat (limited to 'pym')
-rw-r--r--pym/emerge/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 193c7c33e..5f4219259 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -4059,6 +4059,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"])
@@ -4167,14 +4173,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.process.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: