mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-05-07 03:52:30 +02:00
70 lines
2.5 KiB
Bash
Executable file
70 lines
2.5 KiB
Bash
Executable file
#!/bin/bash
|
|
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}"
|
|
}
|
|
|
|
dep_build() {
|
|
emerge --getbinpkg=y --buildpkg=n --jobs="$(nproc)" --load-average="$(nproc)" --verbose --onlydeps "${1}"
|
|
}
|
|
|
|
binpkg_build() {
|
|
emerge --getbinpkg=y --buildpkg=n --jobs="$(nproc)" --load-average="$(nproc)" --verbose "${1}"
|
|
}
|
|
|
|
build() {
|
|
FEATURES="${FEATURES} -getbinpkg" emerge --getbinpkg=n --buildpkg=n --jobs="$(nproc)" --load-average="$(nproc)" --verbose "${1}"
|
|
}
|
|
|
|
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}"
|
|
if dep_build "${test_ebuild}"; then
|
|
printf '%s deps have built, build testing\n' "${i}"
|
|
if binpkg_build "${test_ebuild}"; then
|
|
printf '%s binpkg build SUCCESS\n' "${i}"
|
|
else
|
|
printf '%s binpkg build FAILED\n' "${i}"
|
|
if build "${test_ebuild}"; then
|
|
printf '%s build without binpkgs SUCCESS\n' "${i}"
|
|
else
|
|
printf '%s build without binpkgs also FAILED\n' "${i}"
|
|
FAILED="1"
|
|
fi
|
|
fi
|
|
else
|
|
printf 'WARNING WARNING WARNING\n'
|
|
printf '%s deps failed to build. This is a bad sign which we are ignoring for now\n' "${i}"
|
|
printf 'WARNING WARNING WARNING\n'
|
|
WARNED='1'
|
|
fi
|
|
else
|
|
printf '%s appears to be masked, skipping build test\n' "${i}"
|
|
fi
|
|
fi
|
|
done
|
|
if [ "${WARNED}" = '1' ]; then
|
|
printf 'WARNING WARNING WARNING\n'
|
|
printf 'There were warnings during this build which may be fatal later. Please review the logs.\n'
|
|
printf 'WARNING WARNING WARNING\n'
|
|
else
|
|
printf 'No warnings generated by this script.\n'
|
|
fi
|
|
if [ "${FAILED}" = '0' ]; then
|
|
printf 'No failures seen by this script.\n'
|
|
else
|
|
printf 'FAILED FAILED FAILED\n'
|
|
printf 'Something above failed, please review the output.\n'
|
|
printf 'FAILED FAILED FAILED\n'
|
|
fi
|
|
exit "${FAILED}"
|