Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Support PROPERTIES="live".
Date: Fri, 26 Jul 2019 22:45:08
Message-Id: 3b32f6be9ea6411a92ceb1ed5895bed63f6416b8.camel@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] Support PROPERTIES="live". by "Ulrich Müller"
1 On Fri, 2019-07-26 at 10:51 +0200, Ulrich Müller wrote:
2 > Bug: https://bugs.gentoo.org/233589
3 > Signed-off-by: Ulrich Müller <ulm@g.o>
4 > ---
5 > cnf/sets/portage.conf | 8 +++++++-
6 > lib/_emerge/EbuildExecuter.py | 4 ++--
7 > lib/portage/_sets/__init__.py | 12 +++++++++---
8 > repoman/lib/repoman/modules/scan/ebuild/ebuild.py | 3 +--
9 > 4 files changed, 19 insertions(+), 8 deletions(-)
10 >
11 > diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
12 > index ac282d911..ed4c6d9a7 100644
13 > --- a/cnf/sets/portage.conf
14 > +++ b/cnf/sets/portage.conf
15 > @@ -55,9 +55,15 @@ world-candidate = True
16 > [preserved-rebuild]
17 > class = portage.sets.libs.PreservedLibraryConsumerSet
18 >
19 > -# Installed ebuilds that inherit from known live eclasses.
20 > +# Installed ebuilds with "live" property.
21 > [live-rebuild]
22 > class = portage.sets.dbapi.VariableSet
23 > +variable = PROPERTIES
24 > +includes = live
25 > +
26 > +# Installed ebuilds that inherit from known live eclasses.
27 > +[deprecated-live-rebuild]
28 > +class = portage.sets.dbapi.VariableSet
29 > variable = INHERITED
30 > includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla
31 >
32 > diff --git a/lib/_emerge/EbuildExecuter.py b/lib/_emerge/EbuildExecuter.py
33 > index d387b42be..ca9859437 100644
34 > --- a/lib/_emerge/EbuildExecuter.py
35 > +++ b/lib/_emerge/EbuildExecuter.py
36 > @@ -1,4 +1,4 @@
37 > -# Copyright 1999-2018 Gentoo Foundation
38 > +# Copyright 1999-2019 Gentoo Authors
39 > # Distributed under the terms of the GNU General Public License v2
40 >
41 > from _emerge.EbuildPhase import EbuildPhase
42 > @@ -49,7 +49,7 @@ class EbuildExecuter(CompositeTask):
43 > phase="unpack", scheduler=self.scheduler,
44 > settings=self.settings)
45 >
46 > - if self._live_eclasses.intersection(self.pkg.inherited):
47 > + if "live" in self.settings.get("PROPERTIES", "").split():
48 > # Serialize $DISTDIR access for live ebuilds since
49 > # otherwise they can interfere with eachother.
50 >
51 > diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py
52 > index 2c9bf9715..7b81c55e2 100644
53 > --- a/lib/portage/_sets/__init__.py
54 > +++ b/lib/portage/_sets/__init__.py
55 > @@ -1,4 +1,4 @@
56 > -# Copyright 2007-2014 Gentoo Foundation
57 > +# Copyright 2007-2019 Gentoo Authors
58 > # Distributed under the terms of the GNU General Public License v2
59 >
60 > from __future__ import print_function
61 > @@ -121,8 +121,14 @@ class SetConfig(object):
62 > parser.remove_section("live-rebuild")
63 > parser.add_section("live-rebuild")
64 > parser.set("live-rebuild", "class", "portage.sets.dbapi.VariableSet")
65 > - parser.set("live-rebuild", "variable", "INHERITED")
66 > - parser.set("live-rebuild", "includes", " ".join(sorted(portage.const.LIVE_ECLASSES)))
67 > + parser.set("live-rebuild", "variable", "PROPERTIES")
68 > + parser.set("live-rebuild", "includes", "live")
69 > +
70 > + parser.remove_section("deprecated-live-rebuild")
71 > + parser.add_section("deprecated-live-rebuild")
72 > + parser.set("deprecated-live-rebuild", "class", "portage.sets.dbapi.VariableSet")
73 > + parser.set("deprecated-live-rebuild", "variable", "INHERITED")
74 > + parser.set("deprecated-live-rebuild", "includes", " ".join(sorted(portage.const.LIVE_ECLASSES)))
75 >
76 > parser.remove_section("module-rebuild")
77 > parser.add_section("module-rebuild")
78 > diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
79 > index d2715bc6e..70011e387 100644
80 > --- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
81 > +++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
82 > @@ -12,7 +12,6 @@ from repoman.modules.scan.scanbase import ScanBase
83 > # import our initialized portage instance
84 > from repoman._portage import portage
85 > from portage import os
86 > -from portage.const import LIVE_ECLASSES
87 > from portage.exception import InvalidPackageName
88 >
89 > pv_toolong_re = re.compile(r'[0-9]{19,}')
90 > @@ -110,7 +109,7 @@ class Ebuild(ScanBase):
91 > self.metadata = self.pkg._metadata
92 > self.eapi = self.metadata["EAPI"]
93 > self.inherited = self.pkg.inherited
94 > - self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited)
95 > + self.live_ebuild = "live" in self.metadata["PROPERTIES"].split()
96 > self.keywords = self.metadata["KEYWORDS"].split()
97 > self.archs = set(kw.lstrip("~") for kw in self.keywords if not kw.startswith("-"))
98 > return False
99
100 While at it, could you look into making src_unpack() network-sandbox
101 override apply only to ebuilds with PROPERTIES=live?
102
103 --
104 Best regards,
105 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies