commit:     e9d00e2627bb9bc5376761f6ef26935123aa9479
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 15 03:29:56 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed Dec 16 16:02:26 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e9d00e26

targets: Use interpreter with portage module for build.py

Closes: https://bugs.gentoo.org/759685
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
(cherry picked from commit 37cabf5c536fe8eef16532f18790c1da566aae15)

 targets/stage1/stage1-chroot.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index 4cd0f29f..99539886 100755
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -2,8 +2,13 @@
 
 source /tmp/chroot-functions.sh
 
-# We do this first, so we know our package list for --debug
-buildpkgs=($(/tmp/build.py))
+for module_path in /usr/lib/*/site-packages/portage/__init__.py; do
+       # Find the python interpreter
+       interpreter=$(echo $module_path | cut -d/ -f4)
+
+       buildpkgs=($($interpreter /tmp/build.py 2>/dev/null))
+       [[ $? == 0 ]] && break
+done
 
 ## Sanity check profile
 if [[ ${#buildpkgs[@]} -eq 0 ]]; then

Reply via email to