Mail archive
alpine-aports

[alpine-aports] [PATCH 1/3] abuild: use standard-issue prepare by default

From: Muh Muhten <muh.muhten_at_gmail.com>
Date: Mon, 1 Feb 2016 17:32:27 -0500

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 1f330b1..1b94750 100644
--- a/abuild.in
+++ b/abuild.in
_at_@ -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() {
-- 
2.5.4 (Apple Git-61)
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Feb 01 2016 - 17:32:27 GMT