From 50854d7a8d7b83e0a598f4e1258d3e063a3fe9e0 Mon Sep 17 00:00:00 2001 From: Sheng Yu Date: Fri, 16 Sep 2022 08:19:19 -0400 Subject: Fix wrong creation of empty binpkg from binhost Bug: https://bugs.gentoo.org/870283 Signed-off-by: Sheng Yu Closes: https://github.com/gentoo/portage/pull/901 Signed-off-by: Sam James --- lib/_emerge/Binpkg.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/_emerge/Binpkg.py b/lib/_emerge/Binpkg.py index 949ac8ee7..7ce0da15f 100644 --- a/lib/_emerge/Binpkg.py +++ b/lib/_emerge/Binpkg.py @@ -50,6 +50,7 @@ class Binpkg(CompositeTask): "_pkg_path", "_tree", "_verify", + "_pkg_allocated_path", ) def _writemsg_level(self, msg, level=0, noiselevel=0): @@ -68,6 +69,7 @@ class Binpkg(CompositeTask): self._tree = "bintree" self._bintree = self.pkg.root_config.trees[self._tree] self._verify = not self.opts.pretend + self._pkg_allocated_path = None # Use realpath like doebuild_environment() does, since we assert # that this path is literally identical to PORTAGE_BUILDDIR. @@ -206,6 +208,7 @@ class Binpkg(CompositeTask): # --getbinpkg is enabled. if fetcher is not None: self._fetched_pkg = fetcher.pkg_path + self._pkg_allocated_path = fetcher.pkg_allocated_path if self._default_exit(fetcher) != os.EX_OK: self._async_unlock_builddir(returncode=self.returncode) return @@ -246,7 +249,11 @@ class Binpkg(CompositeTask): if self._fetched_pkg: pkg_path = self._bintree.getname( - self._bintree.inject(pkg.cpv, current_pkg_path=self._fetched_pkg), + self._bintree.inject( + pkg.cpv, + current_pkg_path=self._fetched_pkg, + allocated_pkg_path=self._pkg_allocated_path, + ), allocate_new=False, ) else: -- cgit v1.2.3-65-gdbad