diff options
author | 2024-05-10 12:26:18 +0100 | |
---|---|---|
committer | 2024-06-11 13:57:42 +0100 | |
commit | e320d1eca24c036d3d08fdab14888269c3a05a59 (patch) | |
tree | 6eb3de04418b29342825c57d0c0358f9a6efe269 | |
parent | tar_safe_extract: Use tarfile.fully_trusted_filter (diff) | |
download | portage-e320d1eca24c036d3d08fdab14888269c3a05a59.tar.gz portage-e320d1eca24c036d3d08fdab14888269c3a05a59.tar.bz2 portage-e320d1eca24c036d3d08fdab14888269c3a05a59.zip |
emerge: Make --root-deps install build deps to ROOT plus / for all EAPIs
Rather than instead of / for EAPI 6 and below. This changes the
behaviour, but it is arguably not a breaking change, as no installations
are being dropped. The previous behaviour was highly likely to break
anyway.
Bug: https://bugs.gentoo.org/435066
Closes: https://github.com/gentoo/portage/pull/1319
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
-rw-r--r-- | NEWS | 8 | ||||
-rw-r--r-- | lib/_emerge/depgraph.py | 24 | ||||
-rw-r--r-- | lib/portage/tests/resolver/test_targetroot.py | 6 | ||||
-rw-r--r-- | man/emerge.1 | 20 |
4 files changed, 36 insertions, 22 deletions
@@ -6,6 +6,14 @@ Release notes take the form of the following optional categories: * Bug fixes * Cleanups +portage-3.0.66 (UNRELEASED) +-------------- + +Features: +* emerge: Make bare --root-deps option install build-time dependencies to ROOT + as well as / for all EAPIs rather than instead of / for EAPI 6 and below + (bug #435066). + portage-3.0.65 (2024-06-04) -------------- diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index a05404d9c..2acd8f2e1 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -4040,16 +4040,24 @@ class depgraph: if removal_action: depend_root = myroot else: + root_deps = self._frozen_config.myopts.get("--root-deps") + if eapi_attrs.bdepend: depend_root = pkg.root_config.settings["ESYSROOT"] else: depend_root = self._frozen_config._running_root.root - root_deps = self._frozen_config.myopts.get("--root-deps") - if root_deps is not None: - if root_deps is True: - depend_root = myroot - elif root_deps == "rdeps": - ignore_depend_deps = True + if root_deps == "rdeps": + ignore_depend_deps = True + + if root_deps == True: + edepend["RDEPEND"] += ( + " " + + edepend["IDEPEND"] + + " " + + edepend["DEPEND"] + + " " + + edepend["BDEPEND"] + ) # If rebuild mode is not enabled, it's safe to discard ignored # build-time dependencies. If you want these deps to be traversed @@ -8391,7 +8399,7 @@ class depgraph: for root in self._frozen_config.roots: if root != self._frozen_config.target_root and ( "remove" in self._dynamic_config.myparams - or self._frozen_config.myopts.get("--root-deps") is not None + or self._frozen_config.myopts.get("--root-deps") == "rdeps" ): # Only pull in deps for the relevant root. continue @@ -8626,7 +8634,7 @@ class depgraph: dep_keys = Package._runtime_keys for myroot in self._frozen_config.trees: if ( - self._frozen_config.myopts.get("--root-deps") is not None + self._frozen_config.myopts.get("--root-deps") == "rdeps" and myroot != self._frozen_config.target_root ): continue diff --git a/lib/portage/tests/resolver/test_targetroot.py b/lib/portage/tests/resolver/test_targetroot.py index 642a8b150..8660313b3 100644 --- a/lib/portage/tests/resolver/test_targetroot.py +++ b/lib/portage/tests/resolver/test_targetroot.py @@ -66,7 +66,11 @@ class TargetRootTestCase(TestCase): ambiguous_merge_order=True, success=True, mergelist=[ - ("dev-libs/B-1{targetroot}", "dev-libs/C-1{targetroot}"), + ( + "dev-libs/B-1", + "dev-libs/B-1{targetroot}", + "dev-libs/C-1{targetroot}", + ), "dev-libs/A-1{targetroot}", ], ), diff --git a/man/emerge.1 b/man/emerge.1 index 5c36dc1f0..e30f5f813 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -981,21 +981,15 @@ Set the \fBROOT\fR environment variable. Set the \fBSYSROOT\fR environment variable. .TP .BR \-\-root\-deps[=rdeps] -If no argument is given then build\-time dependencies of packages for -\fBROOT\fR are installed to \fBROOT\fR instead of /. -If the \fBrdeps\fR argument is given then discard all build\-time dependencies -of packages for \fBROOT\fR. -This option is only meaningful when used together with \fBROOT\fR and it should -not be enabled under normal circumstances! +This option is only meaningful when used together with \fBROOT\fR. -Does not affect EAPIs that support \fBBDEPEND\fR. \fBEAPI 7\fR introduces -\fBBDEPEND\fR as a means to adjust installation into / and \fBROOT\fR. Use -the \fBSYSROOT\fR environment variable to control where \fBDEPEND\fR -is installed to under \fBEAPI 7\fR. +If no argument is given, then build\-time dependencies of packages for +\fBROOT\fR are installed to \fBROOT\fR as well as /. -When ebuilds with different EAPIs feature in the same emerge run, the -appropriate behaviour for each EAPI is applied independently to each -ebuild. +If the \fBrdeps\fR argument is given, then all build\-time dependencies of +packages for \fBROOT\fR are ignored entirely. This option should not be enabled +under normal circumstances! It is not applied to ebuilds at \fBEAPI 7\fR or +later. .TP .BR "\-\-search\-index < y | n >" Enable or disable indexed search for search actions. This option is |