test-build: enable FEATURES=test for just the tested ebuilds

This commit is contained in:
Rick Farina (Zero_Chaos) 2025-12-31 19:58:48 -05:00
parent bb307c95fc
commit 9efcae2aa6
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC

View file

@ -3,6 +3,8 @@ WARNED='0'
FAILED='0'
FEATURES='-ipc-sandbox -network-sandbox -pid-sandbox'
export FEATURES
[ -d '/etc/portage/env' ] || mkdir -p /etc/portage/env/
printf 'FEATURES="%s test' "${FEATURES}" >> /etc/portage/env/features-test
pretend_build() {
emerge --getbinpkg=y --buildpkg=n --jobs="$(nproc)" --load-average="$(nproc)" --verbose --pretend "${1}"
@ -19,6 +21,7 @@ build() {
for i in $(git --no-pager diff --name-only "$(git rev-parse --verify origin/master 2> /dev/null)" HEAD); do
if [ "${i%.ebuild}" != "${i}" ]; then
test_ebuild="$(printf '%s' "${i%.ebuild}" | awk -F'/' '{print "="$1"/"$3}')"
printf '%s features-test' "${test_ebuild}" >> /etc/portage/package.env
printf '%s looks like an ebuild, testing visibility\n' "${i}"
if pretend_build "${test_ebuild}" ; then
printf '%s appears to be unmasked, building deps\n' "${i}"