From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RFVuo-0000Wd-C5 for garchives@archives.gentoo.org; Sun, 16 Oct 2011 18:58:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CCE9521C04E; Sun, 16 Oct 2011 18:58:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8A43021C04E for ; Sun, 16 Oct 2011 18:58:22 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E59211B4002 for ; Sun, 16 Oct 2011 18:58:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 350FF80042 for ; Sun, 16 Oct 2011 18:58:21 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <2d78dcda11d753a54f821c7fb482b4bb3b511d0b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: man/, pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: man/emerge.1 pym/_emerge/EbuildBuild.py pym/_emerge/Scheduler.py pym/_emerge/main.py X-VCS-Directories: man/ pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 2d78dcda11d753a54f821c7fb482b4bb3b511d0b Date: Sun, 16 Oct 2011 18:58:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: fe4ff0eeb458b41af043f8a7b770ad87 commit: 2d78dcda11d753a54f821c7fb482b4bb3b511d0b Author: Sebastian Luther gmx de> AuthorDate: Sun Oct 16 18:43:17 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Oct 16 18:58:12 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D2d78dcda Add --binpkg-exclude option This options disables creation of binary packages, no matter what enabled it in the first place. See bug 386903. --- man/emerge.1 | 5 +++++ pym/_emerge/EbuildBuild.py | 3 ++- pym/_emerge/Scheduler.py | 7 ++++++- pym/_emerge/main.py | 28 ++++++++++++++++++++++++---- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/man/emerge.1 b/man/emerge.1 index 1eab6e5..0a1ec03 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -344,6 +344,11 @@ An alternative for already\-merged 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=20 diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 012a1ef..d44dcf3 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -226,7 +226,8 @@ class EbuildBuild(CompositeTask): system_set.findAtomForPackage(pkg) and \ not opts.buildpkg =20 - 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): =20 self._buildpkg =3D True =20 diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 95cc104..3221b86 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -96,7 +96,7 @@ class Scheduler(PollScheduler): ("merge", "jobs", "ebuild_locks", "fetch", "unpack"), prefix=3D"") =20 class _build_opts_class(SlotObject): - __slots__ =3D ("buildpkg", "buildpkgonly", + __slots__ =3D ("buildpkg", "buildpkg_exclude", "buildpkgonly", "fetch_all_uri", "fetchonly", "pretend") =20 class _binpkg_opts_class(SlotObject): @@ -159,8 +159,13 @@ class Scheduler(PollScheduler): self._favorites =3D favorites self._args_set =3D InternalPackageSet(favorites, allow_repo=3DTrue) self._build_opts =3D 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 =3D InternalPackageSet( \ + initial_atoms=3D" ".join(myopts.get("--buildpkg-exclude", [])).split(= ), \ + allow_wildcard=3DTrue, allow_repo=3DTrue) + self._binpkg_opts =3D self._binpkg_opts_class() for k in self._binpkg_opts.__slots__: setattr(self._binpkg_opts, k, "--" + k.replace("_", "-") in myopts) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index ed07c09..26f3766 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -556,19 +556,25 @@ def insert_optional_args(args): =20 return new_args =20 -def _find_bad_atoms(atoms): +def _find_bad_atoms(atoms, less_strict=3DFalse): + """ + 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 =3D [] for x in ' '.join(atoms).split(): bad_atom =3D False try: - atom =3D portage.dep.Atom(x, allow_wildcard=3DTrue) + atom =3D portage.dep.Atom(x, allow_wildcard=3DTrue, allow_repo=3Dless= _strict) except portage.exception.InvalidAtom: try: - atom =3D portage.dep.Atom("*/"+x, allow_wildcard=3DTrue) + atom =3D portage.dep.Atom("*/"+x, allow_wildcard=3DTrue, allow_repo=3D= less_strict) except portage.exception.InvalidAtom: bad_atom =3D True =20 - 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 =20 @@ -644,6 +650,14 @@ def parse_opts(tmpcmdline, silent=3DFalse): "choices" : true_y_or_n }, =20 + "--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" @@ -967,6 +981,12 @@ def parse_opts(tmpcmdline, silent=3DFalse): else: myoptions.buildpkg =3D None =20 + if myoptions.buildpkg_exclude: + bad_atoms =3D _find_bad_atoms(myoptions.buildpkg_exclude, less_strict=3D= 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 =3D "changed-use" myoptions.changed_use =3D False