Gentoo Archives: gentoo-catalyst

From: Matt Turner <mattst88@g.o>
To: gentoo-catalyst@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-catalyst] [PATCH 4/5] targets: Use interpreter with portage module for build.py
Date: Wed, 16 Dec 2020 03:01:52
Message-Id: 20201216030131.14158-4-mattst88@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 1/5] targets: Rename clst_buildpkgs -> buildpkgs by Matt Turner
1 Closes: https://bugs.gentoo.org/759685
2 Signed-off-by: Matt Turner <mattst88@g.o>
3 ---
4 targets/stage1/chroot.sh | 9 +++++++--
5 1 file changed, 7 insertions(+), 2 deletions(-)
6
7 diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
8 index 83cd084d..6b9bfb3e 100755
9 --- a/targets/stage1/chroot.sh
10 +++ b/targets/stage1/chroot.sh
11 @@ -2,8 +2,13 @@
12
13 source /tmp/chroot-functions.sh
14
15 -# We do this first, so we know our package list for --debug
16 -buildpkgs=($(/tmp/build.py))
17 +for module_path in /usr/lib/*/site-packages/portage/__init__.py; do
18 + # Find the python interpreter
19 + interpreter=$(echo $module_path | cut -d/ -f4)
20 +
21 + buildpkgs=($($interpreter /tmp/build.py 2>/dev/null))
22 + [[ $? == 0 ]] && break
23 +done
24
25 ## Sanity check profile
26 if [[ ${#buildpkgs[@]} -eq 0 ]]; then
27 --
28 2.26.2