summaryrefslogtreecommitdiffstats
path: root/bin/emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-19 21:10:45 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-19 21:10:45 +0000
commit3544ab1efef28d2e2f1ae8ae7b1256878808e1db (patch)
treeaac6c9da9c165a4e9a7f2bb556f5a5419d394d64 /bin/emerge
parent7b9c873f13cb4116c467f53bcadf4fe6114a05e1 (diff)
downloadportage-3544ab1efef28d2e2f1ae8ae7b1256878808e1db.tar.gz
portage-3544ab1efef28d2e2f1ae8ae7b1256878808e1db.tar.bz2
portage-3544ab1efef28d2e2f1ae8ae7b1256878808e1db.zip
Fix deprecated RSYNC_TIMEOUT handling (move it where rsync_flags is defined) and direct error messages to stderr via writemsg.
svn path=/main/trunk/; revision=2958
Diffstat (limited to 'bin/emerge')
-rwxr-xr-xbin/emerge20
1 files changed, 8 insertions, 12 deletions
diff --git a/bin/emerge b/bin/emerge
index 385d1dfe0..4d7711ee8 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2507,18 +2507,8 @@ if myaction in ["sync","metadata"] and (not "--help" in myopts):
print "!!! Type \"emerge net-misc/rsync\" to enable rsync support."
sys.exit(1)
mytimeout=180
- if portage.settings.has_key("RSYNC_TIMEOUT"):
- print "WARNING: usage of RSYNC_TIMEOUT is deprecated, use PORTAGE_RSYNC_OPTS instead"
- try:
- mytimeout=int(portage.settings["RSYNC_TIMEOUT"])
- rsync_flags.append("--timeout=%d" % mytimeout)
- except SystemExit, e:
- raise # Needed else can't exit
- except:
- pass
- if (not portage.settings.has_key("PORTAGE_RSYNC_OPTS")) \
- or portage.settings["PORTAGE_RSYNC_OPTS"] == "":
+ if portage.settings["PORTAGE_RSYNC_OPTS"] == "":
print "PORTAGE_RSYNC_OPTS empty or unset, using hardcoded defaults"
rsync_flags = [
"--recursive", # Recurse directories
@@ -2555,7 +2545,13 @@ if myaction in ["sync","metadata"] and (not "--help" in myopts):
if not rsync_opts.find(opt) >= 0:
print yellow("WARNING:")+" adding required option %s not included in PORTAGE_RSYNC_OPTS (override with --exclude='!')" % opt
rsync_flags.append(opt)
-
+ if portage.settings["RSYNC_TIMEOUT"] != "":
+ writemsg("WARNING: usage of RSYNC_TIMEOUT is deprecated, use PORTAGE_RSYNC_OPTS instead\n")
+ try:
+ mytimeout=int(portage.settings["RSYNC_TIMEOUT"])
+ rsync_flags.append("--timeout=%d" % mytimeout)
+ except ValueError, e:
+ writemsg("!!! %s\n" % str(e))
# TODO: determine options required for official servers
if syncuri.rstrip("/").endswith(".gentoo.org/gentoo-portage"):
if not rsync_opts.find("--timeout") >= 0: