From 251dce53e1d19d00f2cbc4d3385b2a28b73e7bb9 Mon Sep 17 00:00:00 2001 From: Michael Zuo Date: Mon, 1 Feb 2016 17:32:27 -0500 Subject: [PATCH] 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(). --- abuild.in | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/abuild.in b/abuild.in index cc3d0c0..7405f74 100644 --- a/abuild.in +++ b/abuild.in @@ -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() {