aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhu Priya Murugan <madhu.murugan@rohde-schwarz.com>2021-11-15 20:24:06 +0100
committerZac Medico <zmedico@gentoo.org>2021-11-19 14:38:45 -0800
commit9a7e865139b6d1dbace2090895348f87cf2a582e (patch)
treec16308fcab76433c3b8ab46f33c3710b76caef18 /lib/_emerge
parentestrip: fix lockfile handling (diff)
downloadportage-9a7e865139b6d1dbace2090895348f87cf2a582e.tar.gz
portage-9a7e865139b6d1dbace2090895348f87cf2a582e.tar.bz2
portage-9a7e865139b6d1dbace2090895348f87cf2a582e.zip
Exclude binary cache build for live ebuilds
This commit introduces a new value "buildpkg-live" for FEATURES, which is enabled by default (so the default behavior of building binary cache for all packages is retained). When it is disabled by calling emerge with FEATURES="-buildpkg-live", binary caches will not be built live ebuilds even if we specify --buildpkg. So that it is no longer necessary to pass a list of packages with live ebuilds to --buildpkg-exclude. Before this commit, when an emerge is called with the option '--buildpkg', a binary cache for the package is created under /var/cache/binpkgs. For example, when we do a, 'emerge --ask --verbose --buildpkg some-gitpkg/abc', a binary cache abc-1.1.1.tbz2 is created under /var/cache/binpkgs/some-gitpkg. With this commit, even if we explicitly use the options, '--buildpkg' for the packages with live ebuilds, no binary cache will be created (given we disable it calling emerge with FEATURES="-buildpkg-live"). Motivation: Since binary caches are created for all packages, including packages with live ebuilds, a separate list of (for eg.,) git packages needs to be maintained. And this is then passed to the options '--buildpkg-exclude' via, EMERGE_DEFAULT_OPTS. So the motivation behind this patch was to reduce redundancy, while we can simply disable binary cache for live ebuilds with this option. Closes: https://github.com/gentoo/portage/pull/766 Signed-off-by: Madhu Priya Murugan <madhu.murugan@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/EbuildBuild.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/_emerge/EbuildBuild.py b/lib/_emerge/EbuildBuild.py
index 2ed16537b..6d290e116 100644
--- a/lib/_emerge/EbuildBuild.py
+++ b/lib/_emerge/EbuildBuild.py
@@ -343,9 +343,24 @@ class EbuildBuild(CompositeTask):
and opts.buildpkg != "n"
)
+ # Do not build binary cache for packages from volatile sources.
+ # For volatile sources (eg., git), the PROPERTIES parameter in
+ # the ebuild is set to 'live'.
+
+ # The default behavior is to build binary cache for all pkgs.
+ # "buildpkg-live" is a FEATURE that is enabled by default.
+ # To not build binary cache for live pkgs, we disable it by
+ # specifying FEATURES="-buildpkg-live"
+
+ buildpkg_live = "buildpkg-live" in features
+ live_ebuild = "live" in self.settings.get("PROPERTIES", "").split()
+ buildpkg_live_disabled = live_ebuild and not buildpkg_live
+
if (
- "buildpkg" in features or self._issyspkg
- ) and not self.opts.buildpkg_exclude.findAtomForPackage(pkg):
+ ("buildpkg" in features or self._issyspkg)
+ and not buildpkg_live_disabled
+ and not self.opts.buildpkg_exclude.findAtomForPackage(pkg)
+ ):
self._buildpkg = True