From a3b954b2f8b768e998244c3e77390374b4ccf34a Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Mon, 8 Oct 2007 17:06:07 +0000 Subject: [PATCH] Merged from trunk 7965:7975 | 7966 | Document IUSE defaults. | | zmedico | | | 7967 | Shorten the reference to IUSE defaults since it's now | | zmedico | documented in ebuild(5). | | 7974 | handle empty sets properly | | genone | | | 7975 | Strip the - prefix from EAPI in getmaskingstatus() if | | zmedico | necessary. | svn path=/main/branches/prefix/; revision=8002 --- man/ebuild.5 | 6 +++++- man/make.conf.5 | 2 +- pym/emerge/__init__.py | 12 +++++++++++- pym/portage/__init__.py | 2 ++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/man/ebuild.5 b/man/ebuild.5 index e07d8f071..dd879a59f 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -172,7 +172,11 @@ must add it first. \fBIUSE\fR This should be a list of any and all USE flags that are leveraged within your build script. The only USE flags that should not be listed here are -arch related flags (see \fBKEYWORDS\fR). +arch related flags (see \fBKEYWORDS\fR). Beginning with \fBEAPI 1\fR, it +is possible to prefix flags with + or - in order to create default settings +that respectively enable or disable the corresponding \fBUSE\fR flags. For +details about \fBUSE\fR flag stacking order, refer to the \fBUSE_ORDER\fR +variable in \fBmake.conf\fR(5). .TP \fBDEPEND\fR This should contain a list of all packages that are required for the diff --git a/man/make.conf.5 b/man/make.conf.5 index ee7493bd1..f0b81b5e8 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -537,7 +537,7 @@ USE from make.conf USE from make.defaults and package.use in the profile (see \fBportage\fR(5)) .TP .B pkginternal -USE from ebuild IUSE defaults (flags enabled via a + prefix; see \fBebuild\fR(5)) +USE from \fBebuild\fR(5) IUSE defaults .TP .B env.d USE from the environment variables defined by files in \fI/etc/env.d/\fR diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 839d8a17d..bea5cd26e 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -6470,6 +6470,7 @@ def emerge_main(): setconfig = make_default_config(settings, trees[settings["ROOT"]]) del setconfigpaths if myaction not in ["search", "metadata", "sync"]: + oldargs = myfiles[:] packagesets, setconfig_errors = setconfig.getSetsWithAliases() for s in packagesets: if s in myfiles: @@ -6477,10 +6478,19 @@ def emerge_main(): if myaction in ["unmerge", "prune", "clean", "depclean"] and not packagesets[s].supportsOperation("unmerge"): print "emerge: the given set %s does not support unmerge operations" % s sys.exit(1) - myfiles.extend(packagesets[s].getAtoms()) + if not packagesets[s].getAtoms(): + print "emerge: '%s' is an empty set" % s + else: + myfiles.extend(packagesets[s].getAtoms()) for e in packagesets[s].errors: print e myfiles.remove(s) + # Need to handle empty sets specially, otherwise emerge will react + # with the help message for empty argument lists + if oldargs and not myfiles: + print "emerge: no targets left after set expansion" + sys.exit(0) + del oldargs if ("--tree" in myopts) and ("--columns" in myopts): print "emerge: can't specify both of \"--tree\" and \"--columns\"." diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 6d5a91a0d..88662b704 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5038,6 +5038,8 @@ def getmaskingstatus(mycpv, settings=None, portdb=None): # The "depend" phase apparently failed for some reason. An associated # error message will have already been printed to stderr. return ["corruption"] + if eapi.startswith("-"): + eapi = eapi[1:] if not eapi_is_supported(eapi): return ["required EAPI %s, supported EAPI %s" % (eapi, portage.const.EAPI)] mygroups = mygroups.split() -- 2.26.2