Commit def21999 authored by Natanael Copa's avatar Natanael Copa

abuild: require package() function

make a missing function for package() a hard error.

this means we never run build in fakeroot.
parent 015f0f69
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment