diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-26 09:18:55 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-26 09:18:55 +0000 |
commit | 728ce0e6de359073451f79984f0d2bdc40696c90 (patch) | |
tree | b9445cde5b5d23375240cb166fbe54ad3f402e99 | |
parent | bfee7b63f923a134ac4847b44c0c451268fec65c (diff) | |
download | abuild-728ce0e6de359073451f79984f0d2bdc40696c90.tar.gz abuild-728ce0e6de359073451f79984f0d2bdc40696c90.tar.bz2 abuild-728ce0e6de359073451f79984f0d2bdc40696c90.tar.xz abuild-728ce0e6de359073451f79984f0d2bdc40696c90.zip |
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.
-rwxr-xr-x | abuild.in | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -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" |