From: Sebastian Luther Date: Sat, 3 Jul 2010 10:58:21 +0000 (+0200) Subject: Warn if FEATURES contains unknown values and don't keep them (bug #326561) X-Git-Tag: v2.2_rc68~533 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8f89f480b8b66b1b2254e937406e4b2b92813894;p=portage.git Warn if FEATURES contains unknown values and don't keep them (bug #326561) --- diff --git a/pym/portage/const.py b/pym/portage/const.py index 445677bd9..0865c02f7 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -82,6 +82,20 @@ EBUILD_PHASES = ("pretend", "setup", "unpack", "prepare", "configure" "compile", "test", "install", "package", "preinst", "postinst","prerm", "postrm", "nofetch", "config", "info", "other") +SUPPORTED_FEATURES = frozenset([ + "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 4cded99c9..a3a372e71 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -24,7 +24,8 @@ from portage import bsd_chflags, eapi_is_supported, \ from portage.const import CACHE_PATH, CUSTOM_PROFILE_PATH, \ DEPCACHE_PATH, GLOBAL_CONFIG_PATH, INCREMENTALS, MAKE_CONF_FILE, \ MODULES_FILE_PATH, PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, \ - PRIVATE_PATH, PROFILE_PATH, USER_CONFIG_PATH, USER_VIRTUALS_FILE + PRIVATE_PATH, PROFILE_PATH, SUPPORTED_FEATURES, USER_CONFIG_PATH, \ + USER_VIRTUALS_FILE from portage.data import portage_gid from portage.dbapi import dbapi from portage.dbapi.porttree import portdbapi @@ -2182,10 +2183,22 @@ class config(object): myflags = [] continue + if mykey == "FEATURES": + if x[:1] in ("+", "-"): + val = x[1:] + else: + val = x + + if val not in SUPPORTED_FEATURES: + writemsg(colorize("BAD", + _("FEATURES variable contains an unknown value: %s") % x) \ + + "\n", noiselevel=-1) + continue + 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: