packages is to use \fBquickpkg\fR(1) which creates a tbz2 from the
live filesystem.
.TP
+.BR "\-\-buildpkg\-exclude " ATOMS
+A space separated list of package atoms for which
+no binary packages should be built. This option overrides all
+possible ways to enable building of binary packages.
+.TP
.BR "\-\-buildpkgonly " (\fB\-B\fR)
Creates binary packages for all ebuilds processed without actually
merging the packages. This comes with the caveat that all build-time
system_set.findAtomForPackage(pkg) and \
not opts.buildpkg
- if opts.buildpkg or "buildpkg" in features or self._issyspkg:
+ if (opts.buildpkg or "buildpkg" in features or self._issyspkg) \
+ and not self.opts.buildpkg_exclude.findAtomForPackage(pkg):
self._buildpkg = True
("merge", "jobs", "ebuild_locks", "fetch", "unpack"), prefix="")
class _build_opts_class(SlotObject):
- __slots__ = ("buildpkg", "buildpkgonly",
+ __slots__ = ("buildpkg", "buildpkg_exclude", "buildpkgonly",
"fetch_all_uri", "fetchonly", "pretend")
class _binpkg_opts_class(SlotObject):
self._favorites = favorites
self._args_set = InternalPackageSet(favorites, allow_repo=True)
self._build_opts = self._build_opts_class()
+
for k in self._build_opts.__slots__:
setattr(self._build_opts, k, "--" + k.replace("_", "-") in myopts)
+ self._build_opts.buildpkg_exclude = InternalPackageSet( \
+ initial_atoms=" ".join(myopts.get("--buildpkg-exclude", [])).split(), \
+ allow_wildcard=True, allow_repo=True)
+
self._binpkg_opts = self._binpkg_opts_class()
for k in self._binpkg_opts.__slots__:
setattr(self._binpkg_opts, k, "--" + k.replace("_", "-") in myopts)
return new_args
-def _find_bad_atoms(atoms):
+def _find_bad_atoms(atoms, less_strict=False):
+ """
+ Declares all atoms as invalid that have an operator,
+ a use dependency, a blocker or a repo spec.
+ It accepts atoms with wildcards.
+ In less_strict mode it accepts operators and repo specs.
+ """
bad_atoms = []
for x in ' '.join(atoms).split():
bad_atom = False
try:
- atom = portage.dep.Atom(x, allow_wildcard=True)
+ atom = portage.dep.Atom(x, allow_wildcard=True, allow_repo=less_strict)
except portage.exception.InvalidAtom:
try:
- atom = portage.dep.Atom("*/"+x, allow_wildcard=True)
+ atom = portage.dep.Atom("*/"+x, allow_wildcard=True, allow_repo=less_strict)
except portage.exception.InvalidAtom:
bad_atom = True
- if bad_atom or atom.operator or atom.blocker or atom.use:
+ if bad_atom or (atom.operator and not less_strict) or atom.blocker or atom.use:
bad_atoms.append(x)
return bad_atoms
"choices" : true_y_or_n
},
+ "--buildpkg-exclude": {
+ "help" :"A space separated list of package atoms for which " + \
+ "no binary packages should be built. This option overrides all " + \
+ "possible ways to enable building of binary packages.",
+
+ "action" : "append"
+ },
+
"--config-root": {
"help":"specify the location for portage configuration files",
"action":"store"
else:
myoptions.buildpkg = None
+ if myoptions.buildpkg_exclude:
+ bad_atoms = _find_bad_atoms(myoptions.buildpkg_exclude, less_strict=True)
+ if bad_atoms and not silent:
+ parser.error("Invalid Atom(s) in --buildpkg-exclude parameter: '%s'\n" % \
+ (",".join(bad_atoms),))
+
if myoptions.changed_use is not False:
myoptions.reinstall = "changed-use"
myoptions.changed_use = False