diff --git a/abuild.in b/abuild.in index 0e1a868..843fd06 100755 --- a/abuild.in +++ b/abuild.in @@ -619,11 +619,22 @@ dev() { default_dev } +is_function() { + type "$1" 2>&1 | head -n 1 | egrep -q "is a (shell )?function" +} + # build and package in fakeroot rootpkg() { + local do_build=build + cd "$startdir" + if is_function package; then + msg "Building without fakeroot" + build || return 1 + do_build= + fi cd "$startdir" msg "Entering fakeroot..." - fakeroot $0 build prepare_subpackages prepare_package create_apks + fakeroot $0 $do_build prepare_subpackages prepare_package create_apks } srcpkg() {