abuild: use standard-issue prepare by default

A majority of APKBUILDs currently use exactly the prepare() provided by
newapkbuild verbatim, even for packages where no patches exist, which
has created the expectation that patches listed as sources are applied
by default.

This rev simply adds that default prepare() to abuild (and exposes it as
default_prepare), with no configurability. If needed, default behaviour
can be overridden by providing explicitly prepare().
This commit is contained in:
Michael Zuo 2016-02-01 17:32:27 -05:00 committed by Timo Teräs
parent 578ab740ad
commit 251dce53e1
1 changed files with 14 additions and 1 deletions

View File

@ -528,8 +528,21 @@ getpkgver() {
fi
}
default_prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch)
msg "$i"
patch -p1 -i "$srcdir/$i" || return 1
;;
esac
done
}
prepare() {
:
default_prepare
}
build() {