diff options
Diffstat (limited to 'abuild.in')
-rw-r--r-- | abuild.in | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -134,7 +134,6 @@ default_sanitycheck() { if [ $(echo "$pkgdesc" | wc -c) -gt 128 ]; then die "pkgdesc is too long" fi - is_function package || die "Missing package() function in APKBUILD" if [ -n "$replaces_priority" ] \ && ! echo $replaces_priority | egrep -q '^[0-9]+$'; then @@ -240,9 +239,11 @@ default_sanitycheck() { makedepends_has 'g++' && ! options_has toolchain && warning "g++ should not be in makedepends" + is_function package || die "Missing package() function in APKBUILD" + if ! options_has "!check" && [ -n "$REQUIRE_CHECK" ]; then - (unset check; . "$APKBUILD"; type check >/dev/null 2>&1) || \ - die "Testsuites (abuild check) are required or need to be explicitly disabled!" + is_function check \ + || die "Testsuites (abuild check) are required or need to be explicitly disabled!" fi check_provides || die "provides must not contain $pkgname" @@ -1757,9 +1758,12 @@ openrc() { } -is_function() { - type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function" -} +is_function() ( + unset -f "$1" >/dev/null 2>&1 || true + unalias "$1" >/dev/null 2>&1 || true + . "$APKBUILD" + PATH= type "$1" >/dev/null 2>&1 +) do_fakeroot() { if [ -n "$FAKEROOT" ]; then |