aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2020-12-14 22:29:56 -0500
committerMatt Turner <mattst88@gentoo.org>2020-12-15 22:01:23 -0500
commit37cabf5c536fe8eef16532f18790c1da566aae15 (patch)
treee661a1353bc0d1e869de9b3b5c7c2f8f354d979d
parenttargets: Move ${buildpkgs} error checking closer (diff)
downloadcatalyst-37cabf5c536fe8eef16532f18790c1da566aae15.tar.gz
catalyst-37cabf5c536fe8eef16532f18790c1da566aae15.tar.bz2
catalyst-37cabf5c536fe8eef16532f18790c1da566aae15.zip
targets: Use interpreter with portage module for build.py
Closes: https://bugs.gentoo.org/759685 Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rwxr-xr-xtargets/stage1/chroot.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index 83cd084d..6b9bfb3e 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/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