From a88f4c3487c4705b0c6bc8dfece46ca0a126db85 Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Sat, 3 Jul 2010 12:58:21 +0200 Subject: [PATCH] Warn if FEATURES contains unknown values --- pym/portage/const.py | 13 +++++++++++++ pym/portage/package/ebuild/config.py | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/pym/portage/const.py b/pym/portage/const.py index 445677b..f1997ba 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -82,6 +82,19 @@ EBUILD_PHASES = ("pretend", "setup", "unpack", "prepare", "configure" "compile", "test", "install", "package", "preinst", "postinst","prerm", "postrm", "nofetch", "config", "info", "other") +SUPPORTED_FEATURES = ("assume-digests", "buildpkg", "buildsyspkg", "ccache", + "collision-protect", "digest", "distcc", "distlocks", + "fakeroot", "fail-clean", "fixpackages", "getbinpkg", + "installsources", "keeptemp", "keepwork", "lmirror", + "metadata-transfer", "mirror", "multilib-strict", "news", + "noauto", "noclean", "nodoc", "noinfo", "noman", "nostrip" + "notitles", "parallel-fetch", "parse-eapi-ebuild-head", + "parse-eapi-glep-55", "preserve-libs", "protect-owned", + "python-trace", "sandbox", "sesandbox", "severe", "sfperms", + "sign", "skiprocheck", "split-elog", "split-log", "splitdebug", + "strict", "stricter", "suidctl", "test", "test-fail-continue", + "unmerge-logs", "unmerge-orphans", "userfetch", "userpriv", + "usersandbox", "usersync", "webrsync-gpg") EAPI = 3 diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 57bbdd5..0c7552f 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -2185,11 +2185,17 @@ class config(object): # so USE="-* gnome" will have *just* gnome enabled. myflags = [] continue + + if mykey == "FEATURES": + if x.lstrip("+-") not in portage.const.SUPPORTED_FEATURES: + writemsg(colorize("BAD", + _("FEATURES variable contains an unknown value: %s") % x) \ + + "\n", noiselevel=-1) if x[0]=="+": # Not legal. People assume too much. Complain. writemsg(colorize("BAD", - _("USE flags should not start with a '+': %s") % x) \ + _("%s values should not start with a '+': %s") % (mykey,x)) \ + "\n", noiselevel=-1) x=x[1:] if not x: -- 1.7.1