From 3544ab1efef28d2e2f1ae8ae7b1256878808e1db Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 19 Mar 2006 21:10:45 +0000 Subject: [PATCH] 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 --- bin/emerge | 20 ++++++++------------ 1 file 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: -- 2.26.2