summaryrefslogtreecommitdiffstats
path: root/pym/portage/_global_updates.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-03 05:45:47 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-03 05:45:47 +0000
commit0f436b2b66f58b3504be6cf5e75a5d6f1f99e799 (patch)
treee13ae7722f279a08ec60d17a9351c3c3c29ec36f /pym/portage/_global_updates.py
parent52bfdfbaf1c9f0765bf57857f7cf69c0d2bf86a5 (diff)
downloadportage-0f436b2b66f58b3504be6cf5e75a5d6f1f99e799.tar.gz
portage-0f436b2b66f58b3504be6cf5e75a5d6f1f99e799.tar.bz2
portage-0f436b2b66f58b3504be6cf5e75a5d6f1f99e799.zip
Make _global_updates() silently return if ROOT != "/" and make fixpackages
bail out with an error message in this case which suggests to instead use emaint --fix movebin and/or moveinst. This prevents useless/ugly global updates messages that flood the terminal when ROOT != "/". svn path=/main/trunk/; revision=15728
Diffstat (limited to 'pym/portage/_global_updates.py')
-rw-r--r--pym/portage/_global_updates.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py
index 040de276a..cdb73187b 100644
--- a/pym/portage/_global_updates.py
+++ b/pym/portage/_global_updates.py
@@ -18,6 +18,8 @@ from portage.util import grabfile, writemsg, writemsg_stdout, write_atomic
def _global_updates(trees, prev_mtimes):
"""
Perform new global updates if they exist in $PORTDIR/profiles/updates/.
+ This simply returns if ROOT != "/" (when len(trees) != 1). If ROOT != "/"
+ then the user should instead use emaint --fix movebin and/or moveinst.
@param trees: A dictionary containing portage trees.
@type trees: dict
@@ -30,8 +32,10 @@ def _global_updates(trees, prev_mtimes):
"""
# only do this if we're root and not running repoman/ebuild digest
- if secpass < 2 or "SANDBOX_ACTIVE" in os.environ:
- return
+ if secpass < 2 or \
+ "SANDBOX_ACTIVE" in os.environ or \
+ len(trees) != 1:
+ return 0
root = "/"
mysettings = trees["/"]["vartree"].settings
updpath = os.path.join(mysettings["PORTDIR"], "profiles", "updates")
@@ -44,7 +48,7 @@ def _global_updates(trees, prev_mtimes):
except DirectoryNotFound:
writemsg(_("--- 'profiles/updates' is empty or "
"not available. Empty portage tree?\n"), noiselevel=1)
- return
+ return 0
myupd = None
if len(update_data) > 0:
do_upgrade_packagesmessage = 0