commit: fadd8b8d89e2e65a97713ed4040d268e5a25a5ab Author: Madhu Priya Murugan <madhu.murugan <AT> rohde-schwarz <DOT> com> AuthorDate: Mon Nov 15 18:56:47 2021 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Fri Nov 19 23:34:12 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=fadd8b8d
Exclude binary pkg installation for live ebuilds This commit introduces a new option "--usepkg-exclude-live" for emerge. Passing this option with the emerge call, will disable binary pkgs from being installed for live ebuilds. So it is no longer necessary to pass a list of live packages to --usepkg-exclude. Before this commit, when an emerge is called with the option '--usepkg', the corresponding package is installed from the binary cache under /var/cache/binpkgs. With this commit, even if we explicitly use the options, '--usepkg' for the packages with live ebuilds, no binary package will not be installed for live ebuilds (given we disable it calling emerge with "--usepkg-exclude-live" in the emerge). Motivation: We no longer need to maintain a separate list for VCS based pkgs (eg., git pkgs), from being installed from the binary cache, and then pass it to --usepkg-exclude. This reduces some redundancy. Closes: https://github.com/gentoo/portage/pull/769 Signed-off-by: Madhu Priya Murugan <madhu.murugan <AT> rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/_emerge/depgraph.py | 12 ++++++++++++ lib/_emerge/main.py | 10 ++++++++++ man/emerge.1 | 5 ++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 22d0be196..07431c8ee 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -7303,6 +7303,7 @@ class depgraph: rebuilt_binaries = "rebuilt_binaries" in self._dynamic_config.myparams usepkg = "--usepkg" in self._frozen_config.myopts usepkgonly = "--usepkgonly" in self._frozen_config.myopts + usepkg_exclude_live = "--usepkg-exclude-live" in self._frozen_config.myopts empty = "empty" in self._dynamic_config.myparams selective = "selective" in self._dynamic_config.myparams reinstall = False @@ -7379,6 +7380,17 @@ class depgraph: ): break + # We can choose not to install a live package from using binary + # cache by disabling it with option --usepkg-exclude-live in the + # emerge call. + if ( + usepkg_exclude_live + and built + and not installed + and "live" in pkg._metadata.get("PROPERTIES", "").split() + ): + continue + useoldpkg = useoldpkg_atoms.findAtomForPackage( pkg, modified_use=self._pkg_use_enabled(pkg) ) diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py index 34555b26c..592a74692 100644 --- a/lib/_emerge/main.py +++ b/lib/_emerge/main.py @@ -179,6 +179,7 @@ def insert_optional_args(args): "--use-ebuild-visibility": y_or_n, "--usepkg": y_or_n, "--usepkgonly": y_or_n, + "--usepkg-exclude-live": y_or_n, "--verbose": y_or_n, "--verbose-slot-rebuilds": y_or_n, "--with-test-deps": y_or_n, @@ -720,6 +721,10 @@ def parse_opts(tmpcmdline, silent=False): "help": "use only binary packages", "choices": true_y_or_n, }, + "--usepkg-exclude-live": { + "help": "do not install from binary packages for live ebuilds", + "choices": true_y_or_n, + }, "--verbose": { "shortopt": "-v", "help": "verbose output", @@ -1115,6 +1120,11 @@ def parse_opts(tmpcmdline, silent=False): else: myoptions.usepkgonly = None + if myoptions.usepkg_exclude_live in true_y: + myoptions.usepkg_exclude_live = True + else: + myoptions.usepkg_exclude_live = None + if myoptions.verbose in true_y: myoptions.verbose = True else: diff --git a/man/emerge.1 b/man/emerge.1 index 8f8c2ebda..8f6d12925 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -1,4 +1,4 @@ -.TH "EMERGE" "1" "Mar 2021" "Portage VERSION" "Portage" +.TH "EMERGE" "1" "Nov 2021" "Portage VERSION" "Portage" .SH "NAME" emerge \- Command\-line interface to the Portage system .SH "SYNOPSIS" @@ -1064,6 +1064,9 @@ packages must be available at the time of dependency calculation or emerge will simply abort. Portage does not use ebuild repositories when calculating dependency information so all masking information is ignored. .TP +.BR "\-\-usepkg\-exclude\-live [ y | n ]" +Tells emerge to not install from binary packages for live ebuilds. +.TP .BR "\-\-verbose [ y | n ]" ", " \-v Tell emerge to run in verbose mode. Currently this flag causes emerge to print out GNU info errors, if any, and to show the USE flags that will be used for
