Re: [gentoo-portage-dev] [PATCH] Support PROPERTIES="live".
On Fri, 2019-07-26 at 10:51 +0200, Ulrich Müller wrote: > Bug: https://bugs.gentoo.org/233589 > Signed-off-by: Ulrich Müller > --- > cnf/sets/portage.conf | 8 +++- > lib/_emerge/EbuildExecuter.py | 4 ++-- > lib/portage/_sets/__init__.py | 12 +--- > repoman/lib/repoman/modules/scan/ebuild/ebuild.py | 3 +-- > 4 files changed, 19 insertions(+), 8 deletions(-) > > diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf > index ac282d911..ed4c6d9a7 100644 > --- a/cnf/sets/portage.conf > +++ b/cnf/sets/portage.conf > @@ -55,9 +55,15 @@ world-candidate = True > [preserved-rebuild] > class = portage.sets.libs.PreservedLibraryConsumerSet > > -# Installed ebuilds that inherit from known live eclasses. > +# Installed ebuilds with "live" property. > [live-rebuild] > class = portage.sets.dbapi.VariableSet > +variable = PROPERTIES > +includes = live > + > +# Installed ebuilds that inherit from known live eclasses. > +[deprecated-live-rebuild] > +class = portage.sets.dbapi.VariableSet > variable = INHERITED > includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla > > diff --git a/lib/_emerge/EbuildExecuter.py b/lib/_emerge/EbuildExecuter.py > index d387b42be..ca9859437 100644 > --- a/lib/_emerge/EbuildExecuter.py > +++ b/lib/_emerge/EbuildExecuter.py > @@ -1,4 +1,4 @@ > -# Copyright 1999-2018 Gentoo Foundation > +# Copyright 1999-2019 Gentoo Authors > # Distributed under the terms of the GNU General Public License v2 > > from _emerge.EbuildPhase import EbuildPhase > @@ -49,7 +49,7 @@ class EbuildExecuter(CompositeTask): > phase="unpack", scheduler=self.scheduler, > settings=self.settings) > > - if self._live_eclasses.intersection(self.pkg.inherited): > + if "live" in self.settings.get("PROPERTIES", "").split(): > # Serialize $DISTDIR access for live ebuilds since > # otherwise they can interfere with eachother. > > diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py > index 2c9bf9715..7b81c55e2 100644 > --- a/lib/portage/_sets/__init__.py > +++ b/lib/portage/_sets/__init__.py > @@ -1,4 +1,4 @@ > -# Copyright 2007-2014 Gentoo Foundation > +# Copyright 2007-2019 Gentoo Authors > # Distributed under the terms of the GNU General Public License v2 > > from __future__ import print_function > @@ -121,8 +121,14 @@ class SetConfig(object): > parser.remove_section("live-rebuild") > parser.add_section("live-rebuild") > parser.set("live-rebuild", "class", > "portage.sets.dbapi.VariableSet") > - parser.set("live-rebuild", "variable", "INHERITED") > - parser.set("live-rebuild", "includes", " > ".join(sorted(portage.const.LIVE_ECLASSES))) > + parser.set("live-rebuild", "variable", "PROPERTIES") > + parser.set("live-rebuild", "includes", "live") > + > + parser.remove_section("deprecated-live-rebuild") > + parser.add_section("deprecated-live-rebuild") > + parser.set("deprecated-live-rebuild", "class", > "portage.sets.dbapi.VariableSet") > + parser.set("deprecated-live-rebuild", "variable", "INHERITED") > + parser.set("deprecated-live-rebuild", "includes", " > ".join(sorted(portage.const.LIVE_ECLASSES))) > > parser.remove_section("module-rebuild") > parser.add_section("module-rebuild") > diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py > b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py > index d2715bc6e..70011e387 100644 > --- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py > +++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py > @@ -12,7 +12,6 @@ from repoman.modules.scan.scanbase import ScanBase > # import our initialized portage instance > from repoman._portage import portage > from portage import os > -from portage.const import LIVE_ECLASSES > from portage.exception import InvalidPackageName > > pv_toolong_re = re.compile(r'[0-9]{19,}') > @@ -110,7 +109,7 @@ class Ebuild(ScanBase): > self.metadata = self.pkg._metadata > self.eapi = self.metadata["EAPI"] > self.inherited = self.pkg.inherited > - self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited) > + self.live_ebuild = "live" in self.metadata["PROPERTIES"].split() > self.keywords = self.metadata["KEYWORDS"].split() > self.archs = set(kw.lstrip("~") for kw in self.keywords if not > kw.startswith("-")) > return False While at it, could you look into making src_unpack() network-sandbox override apply only to ebuilds with PROPERTIES=live? -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part
Re: [gentoo-portage-dev] [PATCH] Support PROPERTIES="live".
> On Fri, 26 Jul 2019, Zac Medico wrote: > Looks good. Please merge. Will do, as soon as the live eclasses set PROPERTIES="live". Ulrich signature.asc Description: PGP signature
Re: [gentoo-portage-dev] [PATCH] Drop removed git and tla from list of live eclasses.
On 7/26/19 2:28 AM, Ulrich Müller wrote: > Signed-off-by: Ulrich Müller > --- > cnf/sets/portage.conf | 2 +- > lib/portage/const.py | 4 +--- > 2 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf > index ed4c6d9a7..38c50a647 100644 > --- a/cnf/sets/portage.conf > +++ b/cnf/sets/portage.conf > @@ -65,7 +65,7 @@ includes = live > [deprecated-live-rebuild] > class = portage.sets.dbapi.VariableSet > variable = INHERITED > -includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla > +includes = bzr cvs darcs git-2 git-r3 golang-vcs mercurial subversion > > # Installed packages that own files inside /lib/modules. > [module-rebuild] > diff --git a/lib/portage/const.py b/lib/portage/const.py > index edbfb9f17..0ed64a742 100644 > --- a/lib/portage/const.py > +++ b/lib/portage/const.py > @@ -1,5 +1,5 @@ > # portage: Constants > -# Copyright 1998-2018 Gentoo Authors > +# Copyright 1998-2019 Gentoo Authors > # Distributed under the terms of the GNU General Public License v2 > > from __future__ import unicode_literals > @@ -240,13 +240,11 @@ LIVE_ECLASSES = frozenset([ > "bzr", > "cvs", > "darcs", > - "git", > "git-2", > "git-r3", > "golang-vcs", > "mercurial", > "subversion", > - "tla", > ]) > > SUPPORTED_BINPKG_FORMATS = ("tar", "rpm") > Looks good. Please merge. -- Thanks, Zac signature.asc Description: OpenPGP digital signature
Re: [gentoo-portage-dev] [PATCH] Support PROPERTIES="live".
On 7/26/19 1:51 AM, Ulrich Müller wrote: > Bug: https://bugs.gentoo.org/233589 > Signed-off-by: Ulrich Müller > --- > cnf/sets/portage.conf | 8 +++- > lib/_emerge/EbuildExecuter.py | 4 ++-- > lib/portage/_sets/__init__.py | 12 +--- > repoman/lib/repoman/modules/scan/ebuild/ebuild.py | 3 +-- > 4 files changed, 19 insertions(+), 8 deletions(-) Looks good. Please merge. -- Thanks, Zac signature.asc Description: OpenPGP digital signature
[gentoo-portage-dev] [PATCH] Drop removed git and tla from list of live eclasses.
Signed-off-by: Ulrich Müller --- cnf/sets/portage.conf | 2 +- lib/portage/const.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf index ed4c6d9a7..38c50a647 100644 --- a/cnf/sets/portage.conf +++ b/cnf/sets/portage.conf @@ -65,7 +65,7 @@ includes = live [deprecated-live-rebuild] class = portage.sets.dbapi.VariableSet variable = INHERITED -includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla +includes = bzr cvs darcs git-2 git-r3 golang-vcs mercurial subversion # Installed packages that own files inside /lib/modules. [module-rebuild] diff --git a/lib/portage/const.py b/lib/portage/const.py index edbfb9f17..0ed64a742 100644 --- a/lib/portage/const.py +++ b/lib/portage/const.py @@ -1,5 +1,5 @@ # portage: Constants -# Copyright 1998-2018 Gentoo Authors +# Copyright 1998-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -240,13 +240,11 @@ LIVE_ECLASSES = frozenset([ "bzr", "cvs", "darcs", - "git", "git-2", "git-r3", "golang-vcs", "mercurial", "subversion", - "tla", ]) SUPPORTED_BINPKG_FORMATS = ("tar", "rpm") -- 2.22.0 signature.asc Description: PGP signature
[gentoo-portage-dev] [PATCH] Support PROPERTIES="live".
Bug: https://bugs.gentoo.org/233589 Signed-off-by: Ulrich Müller --- cnf/sets/portage.conf | 8 +++- lib/_emerge/EbuildExecuter.py | 4 ++-- lib/portage/_sets/__init__.py | 12 +--- repoman/lib/repoman/modules/scan/ebuild/ebuild.py | 3 +-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf index ac282d911..ed4c6d9a7 100644 --- a/cnf/sets/portage.conf +++ b/cnf/sets/portage.conf @@ -55,9 +55,15 @@ world-candidate = True [preserved-rebuild] class = portage.sets.libs.PreservedLibraryConsumerSet -# Installed ebuilds that inherit from known live eclasses. +# Installed ebuilds with "live" property. [live-rebuild] class = portage.sets.dbapi.VariableSet +variable = PROPERTIES +includes = live + +# Installed ebuilds that inherit from known live eclasses. +[deprecated-live-rebuild] +class = portage.sets.dbapi.VariableSet variable = INHERITED includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla diff --git a/lib/_emerge/EbuildExecuter.py b/lib/_emerge/EbuildExecuter.py index d387b42be..ca9859437 100644 --- a/lib/_emerge/EbuildExecuter.py +++ b/lib/_emerge/EbuildExecuter.py @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from _emerge.EbuildPhase import EbuildPhase @@ -49,7 +49,7 @@ class EbuildExecuter(CompositeTask): phase="unpack", scheduler=self.scheduler, settings=self.settings) - if self._live_eclasses.intersection(self.pkg.inherited): + if "live" in self.settings.get("PROPERTIES", "").split(): # Serialize $DISTDIR access for live ebuilds since # otherwise they can interfere with eachother. diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py index 2c9bf9715..7b81c55e2 100644 --- a/lib/portage/_sets/__init__.py +++ b/lib/portage/_sets/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2007-2014 Gentoo Foundation +# Copyright 2007-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -121,8 +121,14 @@ class SetConfig(object): parser.remove_section("live-rebuild") parser.add_section("live-rebuild") parser.set("live-rebuild", "class", "portage.sets.dbapi.VariableSet") - parser.set("live-rebuild", "variable", "INHERITED") - parser.set("live-rebuild", "includes", " ".join(sorted(portage.const.LIVE_ECLASSES))) + parser.set("live-rebuild", "variable", "PROPERTIES") + parser.set("live-rebuild", "includes", "live") + + parser.remove_section("deprecated-live-rebuild") + parser.add_section("deprecated-live-rebuild") + parser.set("deprecated-live-rebuild", "class", "portage.sets.dbapi.VariableSet") + parser.set("deprecated-live-rebuild", "variable", "INHERITED") + parser.set("deprecated-live-rebuild", "includes", " ".join(sorted(portage.const.LIVE_ECLASSES))) parser.remove_section("module-rebuild") parser.add_section("module-rebuild") diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py index d2715bc6e..70011e387 100644 --- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py +++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py @@ -12,7 +12,6 @@ from repoman.modules.scan.scanbase import ScanBase # import our initialized portage instance from repoman._portage import portage from portage import os -from portage.const import LIVE_ECLASSES from portage.exception import InvalidPackageName pv_toolong_re = re.compile(r'[0-9]{19,}') @@ -110,7 +109,7 @@ class Ebuild(ScanBase): self.metadata = self.pkg._metadata self.eapi = self.metadata["EAPI"] self.inherited = self.pkg.inherited - self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited) + self.live_ebuild = "live" in self.metadata["PROPERTIES"].split() self.keywords = self.metadata["KEYWORDS"].split() self.archs = set(kw.lstrip("~") for kw in self.keywords if not kw.startswith("-")) return False -- 2.22.0 signature.asc Description: PGP signature
Re: [gentoo-portage-dev] [RFC] Adding extra vars to md5-cache, for QA purposes
Hi, On 25-07-2019 14:20:50 +0200, Michał Górny wrote: > Hi, > > TL;DR: I'd like to make it possible for ebuilds to define additional > variables that will be stored in md5-cache. This would be useful for CI > and other tooling that right now has to parse ebuilds for other data. Only downside I can think of, is a diskspace increase for the md5-cache. Not sure if this is going to be substantial, but given things like PYTHON_COMPAT, perhaps a quick calculation of extra "cost" can be made. Should diskspace become a problem, one could consider to use a separate file/dir, that users could rsync-exclude, since Portage won't need it to operate properly. Thanks, Fabian > > > The idea is to add a new incremental ebuild/eclass variable (technical > name: QA_EXTRA_CACHE_VARS) that would define additional data to be > stored in cache. For example, python*-r1 eclasses would define > 'PYTHON_COMPAT', acct-user would define 'ACCT_USER_ID', etc. > > When regenerating cache, the PM would read this variable, and store > the values of all defined variables into md5-cache. As a result, > programs needing those variables can get them straight from cache > without having to attempt to run or parse ebuilds (which is both slow > and prone to bugs). > > This would benefit e.g. gpyutils that right now need to attempt to parse > PYTHON_COMPAT from ebuilds. It would also benefit writing future > pkgcheck checks for user/group ID collisions. > > > Notes: > > - since md5-cache uses key-value format and allows for future > extensions, the new values can be added without breaking anything; > > - md5-cache is not specified in the PMS, and the whole thing can be > implemented without need for EAPI bump, > > - I would like to have this implemented consistently both in Portage > and pkgcore, > > - we will need to clearly define how to dump arrays. > > > What do you think? > > -- > Best regards, > Michał Górny > -- Fabian Groffen Gentoo on a different level signature.asc Description: PGP signature