Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/devtools/PKGBUILD
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-03-05 10:12:42 +0100
committerErich Eckner <git@eckner.net>2020-03-05 10:12:42 +0100
commit2daf5647b6961ff6281d5c89b50783e5258a6b4b (patch)
tree0ff7915683c1d5e0095605912940f94cb65c1643 /extra/devtools/PKGBUILD
parent3271f6ab8a92141c0e6e696b327198795f611006 (diff)
do not overwrite prepare if it already existed
Diffstat (limited to 'extra/devtools/PKGBUILD')
-rw-r--r--extra/devtools/PKGBUILD22
1 files changed, 14 insertions, 8 deletions
diff --git a/extra/devtools/PKGBUILD b/extra/devtools/PKGBUILD
index 19bd31a0..37f0da9d 100644
--- a/extra/devtools/PKGBUILD
+++ b/extra/devtools/PKGBUILD
@@ -17,14 +17,20 @@ unset b2sums
makedepends+=('asciidoc')
-prepare() {
- cd "${srcdir}/${pkgname}32-v${pkgver}"
- sed -i '
- s,\$working_dir/etc/pacman\.d/mirrorlist32,/dev/null,
- s/mirrorlist32/mirrorlist/g
- ' 'arch-nspawn.in'
- sed -i 's@s,/mirrorlist\\\$\$,\\032,;\?@@' 'Makefile'
-}
+eval "$(
+ {
+ declare -f prepare || \
+ printf 'prepare() {\n}\n'
+ } \
+ | sed '
+ $i cd "${srcdir}/${pkgname}32-v${pkgver}" \
+ sed -i '"'"' \
+ s,\$working_dir/etc/pacman\.d/mirrorlist32,/dev/null, \
+ s/mirrorlist32/mirrorlist/g \
+ '"'"' '"'"'arch-nspawn.in'"'"' \
+ sed -i '"'"'s@s,/mirrorlist\\\$\$,\\032,;\?@@'"'"' '"'"'Makefile'"'"'
+ '
+)"
eval "$(
declare -f prepare build check package | \