summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-09-15 18:54:22 +0000
committerZac Medico <zmedico@gentoo.org>2008-09-15 18:54:22 +0000
commit193832586b48a1ae7cdcfe800077b88ec1c12cc0 (patch)
tree1e8a25d25332262fe0e7a3ac75c4d9a7f7aa2fd2
parenta2e926d21b0e0837e682503237d4a18f0a82e3c2 (diff)
downloadportage-193832586b48a1ae7cdcfe800077b88ec1c12cc0.tar.gz
portage-193832586b48a1ae7cdcfe800077b88ec1c12cc0.tar.bz2
portage-193832586b48a1ae7cdcfe800077b88ec1c12cc0.zip
Improve error messages for issues with the SYNC variable inside action_sync().
svn path=/main/trunk/; revision=11513
-rw-r--r--pym/_emerge/__init__.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index cef13e3e8..aabb02687 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -11078,7 +11078,12 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
if not os.path.exists(myportdir):
print ">>>",myportdir,"not found, creating it."
os.makedirs(myportdir,0755)
- syncuri=settings["SYNC"].rstrip()
+ syncuri = settings.get("SYNC", "").strip()
+ if not syncuri:
+ writemsg_level("!!! SYNC is undefined. Is /etc/make.globals missing?\n",
+ noiselevel=-1, level=logging.ERROR)
+ return 1
+
os.umask(0022)
updatecache_flg = False
if myaction == "metadata":
@@ -11482,8 +11487,9 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
sys.exit(retval)
dosyncuri = syncuri
else:
- print "!!! rsync setting: ",syncuri,"not recognized; exiting."
- sys.exit(1)
+ writemsg_level("!!! Unrecognized protocol: SYNC='%s'\n" % (syncuri,),
+ noiselevel=-1, level=logging.ERROR)
+ return 1
if updatecache_flg and \
myaction != "metadata" and \
@@ -11528,6 +11534,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
print
display_news_notification(root_config, myopts)
+ return os.EX_OK
def action_metadata(settings, portdb, myopts):
portage.writemsg_stdout("\n>>> Updating Portage cache: ")
@@ -13746,7 +13753,7 @@ def emerge_main():
root_config = trees[settings["ROOT"]]["root_config"]
if "sync" == myaction:
- action_sync(settings, trees, mtimedb, myopts, myaction)
+ return action_sync(settings, trees, mtimedb, myopts, myaction)
elif "metadata" == myaction:
action_metadata(settings, portdb, myopts)
elif myaction=="regen":