diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-03-03 05:45:47 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-03-03 05:45:47 +0000 |
commit | 0f436b2b66f58b3504be6cf5e75a5d6f1f99e799 (patch) | |
tree | e13ae7722f279a08ec60d17a9351c3c3c29ec36f /bin | |
parent | Unlink log instead of truncate, to avoid leaving empty log in (diff) | |
download | portage-idfetch-0f436b2b66f58b3504be6cf5e75a5d6f1f99e799.tar.gz portage-idfetch-0f436b2b66f58b3504be6cf5e75a5d6f1f99e799.tar.bz2 portage-idfetch-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 'bin')
-rwxr-xr-x | bin/fixpackages | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/fixpackages b/bin/fixpackages index 22f90dd2..37cdf282 100755 --- a/bin/fixpackages +++ b/bin/fixpackages @@ -15,11 +15,22 @@ except ImportError: import portage from portage import os +from portage.output import EOutput +from textwrap import wrap from portage._global_updates import _global_updates mysettings = portage.settings mytrees = portage.db mtimedb = portage.mtimedb +if mysettings['ROOT'] != "/": + out = EOutput() + msg = "The fixpackages program is not intended for use with " + \ + "ROOT != \"/\". Instead use `emaint --fix movebin` and/or " + \ + "`emaint --fix moveinst." + for line in wrap(msg, 72): + out.eerror(line) + sys.exit(1) + try: os.nice(int(mysettings.get("PORTAGE_NICENESS", "0"))) except (OSError, ValueError) as e: |