From 728ce0e6de359073451f79984f0d2bdc40696c90 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 26 Jul 2013 09:18:55 +0000 Subject: [PATCH] abuild: dont run 'build' from rootpkg we want be able to run build and rootpkg separately. so you can stop in the process, fix things, and then continue with 'abuild rootpkg' to generate the package manually. --- abuild.in | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/abuild.in b/abuild.in index 91f0a00..aad6b23 100755 --- a/abuild.in +++ b/abuild.in @@ -143,6 +143,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" if [ -n "$replaces_priority" ] \ && ! echo $replaces_priority | egrep -q '^[0-9]+$'; then @@ -1196,11 +1197,16 @@ mklinks_abuildrepo() { } build_abuildrepo() { - local d apk + local d apk _build=build + if ! is_function package; then + # if package() is missing then build is called from rootpkg + _build=true + fi if ! apk_up2date || [ -n "$force" ]; then logcmd "building $pkgname" sanitycheck && builddeps && clean && fetch && unpack \ - && post_unpack && prepare && mkusers && rootpkg \ + && post_unpack && prepare && mkusers && $_build \ + && rootpkg \ || return 1 fi update_abuildrepo_index @@ -1324,15 +1330,17 @@ do_fakeroot() { # build and package in fakeroot rootpkg() { - local do_build=build - cd "$startdir" - if is_function package; then - build || return 1 - do_build=package + 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 $do_build \ + do_fakeroot "$abuild_path" $color_opt \ + $_package \ prepare_subpackages \ prepare_language_packs \ prepare_package \ @@ -1814,7 +1822,7 @@ usage() { echo " build Compile and install package into \$pkgdir" echo " listpkg List target packages" echo " package Create package in \$PKGDEST" - echo " rootpkg Run '$0 build package' as fakeroot" + echo " rootpkg Run 'package', the split functions and create apks as fakeroot" echo " clean Remove temp build and install dirs" echo " cleanoldpkg Remove binary packages except current version" echo " cleanpkg Remove already built binary and source package"