From fc0e49d98177691813fe81d0ef678bb7192180b3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 11 Jul 2010 14:25:21 -0700 Subject: Add FEATURES=unknown-features-warn, so the the warning about unknown FEATURES values can be disabled. --- cnf/make.globals | 3 ++- man/make.conf.5 | 3 +++ pym/portage/const.py | 1 + pym/portage/package/ebuild/config.py | 21 +++++++++++---------- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/cnf/make.globals b/cnf/make.globals index 42e7d3215..78088e006 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -45,7 +45,8 @@ RESUMECOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\"" # Default user options FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned - sandbox sfperms strict unmerge-logs unmerge-orphans userfetch" + sandbox sfperms strict unknown-features-warn unmerge-logs + unmerge-orphans userfetch" # Ignore file collisions in /lib/modules since files inside this directory # are never unmerged, and therefore collisions must be ignored in order for diff --git a/man/make.conf.5 b/man/make.conf.5 index b033e7ac0..71840f95a 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -438,6 +438,9 @@ If a file is not claimed by another package in the same slot and it is not protected by \fICONFIG_PROTECT\fR, unmerge it even if the modification time or checksum differs from the file that was originally installed. .TP +.B unknown\-features\-warn +Warn if FEATURES contains one or more unknown values. +.TP .B userfetch When portage is run as root, drop privileges to portage:portage during the fetching of package sources. diff --git a/pym/portage/const.py b/pym/portage/const.py index 0865c02f7..dc8155102 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -94,6 +94,7 @@ SUPPORTED_FEATURES = frozenset([ "python-trace", "sandbox", "sesandbox", "severe", "sfperms", "sign", "skiprocheck", "split-elog", "split-log", "splitdebug", "strict", "stricter", "suidctl", "test", "test-fail-continue", + "unknown-features-warn", "unmerge-logs", "unmerge-orphans", "userfetch", "userpriv", "usersandbox", "usersync", "webrsync-gpg"]) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 2874dc3ce..b0fecae8f 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1152,16 +1152,17 @@ class config(object): writemsg(_("!!! FEATURES=fakeroot is enabled, but the " "fakeroot binary is not installed.\n"), noiselevel=-1) - unsupported_features = [] - for x in self.features: - if x not in SUPPORTED_FEATURES: - unsupported_features.append(x) - - if unsupported_features: - writemsg(colorize("BAD", - _("FEATURES variable contains an unknown value(s): %s") % \ - ", ".join(unsupported_features)) \ - + "\n", noiselevel=-1) + if 'unknown-features-warn' in self.features: + unknown_features = [] + for x in self.features: + if x not in SUPPORTED_FEATURES: + unknown_features.append(x) + + if unknown_features: + writemsg(colorize("BAD", + _("FEATURES variable contains an unknown value(s): %s") % \ + ", ".join(unknown_features)) \ + + "\n", noiselevel=-1) def loadVirtuals(self,root): """Not currently used by portage.""" -- cgit v1.2.3-1-g7c22