From 0f436b2b66f58b3504be6cf5e75a5d6f1f99e799 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 3 Mar 2010 05:45:47 +0000 Subject: 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 --- bin/fixpackages | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin') diff --git a/bin/fixpackages b/bin/fixpackages index 22f90dd2b..37cdf2825 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: -- cgit v1.2.3-1-g7c22