diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-09-13 23:41:10 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-09-13 23:41:10 +0000 |
commit | 6ce3813f802d4d88d3d28e4226b4b73ee6445064 (patch) | |
tree | 1735089dc961678db66008a7501fbd301a46ba72 | |
parent | 6655bc6e8613f87c98f837c191cf9fd4bbe80c73 (diff) | |
download | portage-6ce3813f802d4d88d3d28e4226b4b73ee6445064.tar.gz portage-6ce3813f802d4d88d3d28e4226b4b73ee6445064.tar.bz2 portage-6ce3813f802d4d88d3d28e4226b4b73ee6445064.zip |
Bug #192341 - Make emerge bail out on FreeBSD if the freebsd python module
fails to import. Display a notification that "ignore-missing-freebsd-module"
can be added to FEATURES in order to bypass the error. If that feature is
enabled but the freebsd python module imported successfully, show a warning
message since the user should remove if from FEATURES asap.
svn path=/main/trunk/; revision=7780
-rw-r--r-- | pym/emerge/__init__.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index b09e20537..ca322a8f2 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -6106,6 +6106,43 @@ def validate_ebuild_environment(trees): print >> sys.stderr, bad("\a!!! Is the symlink correct? " + \ "Is your portage tree complete?\n") sys.exit(9) + if myroot == "/" and \ + portage.data.ostype == "FreeBSD": + ignore_missing = "ignore-missing-freebsd-module" + msg = None + die = False + if portage.bsd_chflags is not None and \ + ignore_missing in mysettings.features: + msg = \ + "Do NOT forget to remove \"%s\" " % ignore_missing + \ + "from FEATURES as soon as " + \ + "the freebsd python module has been properly " + \ + "installed." + elif portage.bsd_chflags is None and \ + ignore_missing not in mysettings.features: + die = True + msg = \ + "An error occurred while attempting to import the " + \ + "freebsd python module. This usually means that " + \ + "python has just been upgraded and the py-freebsd " + \ + "package has not yet been rebuilt by python-updater. " + \ + "The freebsd python module is required for proper " + \ + "operation. Please install or rebuild py-freebsd as " + \ + "soon as possible. In order to bypass this error, " + \ + "add \"%s\" to FEATURES. " % ignore_missing + \ + "Do NOT forget to remove it from FEATURES as soon as " + \ + "the freebsd python module has been properly " + \ + "installed." + if msg: + width = 72 # leave room for the " * " prefix + from textwrap import wrap + for line in wrap(msg, width): + sys.stderr.write(bad(" * ")) + sys.stderr.write(line) + sys.stderr.write("\n") + sys.stderr.flush() + if die: + sys.exit(9) del myroot, mysettings def load_emerge_config(trees=None): |