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
@@ -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@lists.alpinelinux.org
Help: alpine-aports+help@lists.alpinelinux.org
---
Do not add prepare() to new APKBUILDs in the future, as this
functionality is superseded by the addition of the default prepare
patcher in abuild.
---
newapkbuild.in | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/newapkbuild.in b/newapkbuild.in
index a47dcae..64b726b 100644
--- a/newapkbuild.in+++ b/newapkbuild.in
@@ -224,21 +224,6 @@ __EOF__
fi
fi
-- # Create the prepare() template- cat >>APKBUILD<<__EOF__-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-}--__EOF__- # Create build() function
cat >>APKBUILD<<__EOF__
build() {
--
2.5.4 (Apple Git-61)
---
Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org
Help: alpine-aports+help@lists.alpinelinux.org
---
Nothing special. An added prepare() will function correctly and be run
instead of default prepare.
To clear up some confusion: this patch is intended to apply in the
context of %1521; default_prepare is *not* implemented yet, I just sent
in the two patches together.
Only APKBUILDs with no prepare() definition should be affected; there is
no change to the logic when abuild calls prepare, only the default
function definition changes from silent no-op to the patching behavior
newapkbuild generates.
Michael
On 2016-02-02 12:50 AM, Olivier Mauras wrote:
> Hello,>> How does that behave if one adds prepare() back in the APKBUILD? prepare() can be used for other things than just patches.>> Regards,> Olivier>
---
Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org
Help: alpine-aports+help@lists.alpinelinux.org
---
On Mon, 1 Feb 2016 17:32:28 -0500
Muh Muhten <muh.muhten@gmail.com> wrote:
> Do not add prepare() to new APKBUILDs in the future, as this> functionality is superseded by the addition of the default prepare> patcher in abuild.> ---> newapkbuild.in | 15 ---------------> 1 file changed, 15 deletions(-)> > diff --git a/newapkbuild.in b/newapkbuild.in> index a47dcae..64b726b 100644> --- a/newapkbuild.in> +++ b/newapkbuild.in> @@ -224,21 +224,6 @@ __EOF__> fi> fi> > -> - # Create the prepare() template> - cat >>APKBUILD<<__EOF__> -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> -}> -> -__EOF__> -> # Create build() function> cat >>APKBUILD<<__EOF__> build() {> -- > 2.5.4 (Apple Git-61)> > > > ---> Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org> Help: alpine-aports+help@lists.alpinelinux.org> ---
Hello,
How does that behave if one adds prepare() back in the APKBUILD? prepare() can be used for other things than just patches.
Regards,
Olivier