From def219994d2dff3c2bd47eee76826dc79e042b2f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 3 Oct 2018 11:10:55 +0000 Subject: abuild: require package() function make a missing function for package() a hard error. this means we never run build in fakeroot. --- abuild.in | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'abuild.in') diff --git a/abuild.in b/abuild.in index 8a54061..f3ee0d4 100644 --- a/abuild.in +++ b/abuild.in @@ -134,7 +134,7 @@ default_sanitycheck() { if [ $(echo "$pkgdesc" | wc -c) -gt 128 ]; then die "pkgdesc is too long" fi - is_function package || warning "Missing package() function in APKBUILD" + is_function package || die "Missing package() function in APKBUILD" if [ -n "$replaces_priority" ] \ && ! echo $replaces_priority | egrep -q '^[0-9]+$'; then @@ -1502,11 +1502,7 @@ create_apks() { } build_abuildrepo() { - local d apk _build=build _check=check_fakeroot - if ! is_function package; then - # if package() is missing then build is called from rootpkg - _build=true - fi + local d apk _check=check_fakeroot if options_has "!checkroot"; then _check=check fi @@ -1525,7 +1521,6 @@ build_abuildrepo() { unpack prepare mkusers - $_build $_check rootpkg cleanup $CLEANUP @@ -1764,17 +1759,11 @@ check_fakeroot() { # build and package in fakeroot rootpkg() { - local _package=package - if ! is_function package; then - # if package() is missing then run 'build' in fakeroot instead - warning "No package() function in APKBUILD" - _package=build - fi cd "$startdir" rm -rf "$pkgdir" [ -n "$FAKEROOT" ] && msg "Entering fakeroot..." do_fakeroot "$abuild_path" $color_opt $keep_build \ - $_package \ + package \ prepare_subpackages \ prepare_language_packs \ prepare_package \ @@ -2129,18 +2118,14 @@ checksum() { } rootbld_actions() { - local part _build=build _check=check_fakeroot - if ! is_function package; then - # if package() is missing then build is called from rootpkg - _build=true - fi + local part _check=check_fakeroot if options_has "!checkroot"; then _check=check fi if ! want_check; then _check=true fi - for part in symlinksrc unpack prepare $_build $_check rootpkg; do + for part in symlinksrc unpack prepare $_check rootpkg; do runpart $part done } -- cgit v1.2.3