summaryrefslogtreecommitdiffstats
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-10-03 10:31:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-10-03 10:34:58 +0000
commit1cbc853155b99aa062b1f30dd4d2c29fb9576e20 (patch)
treecfc9681e0e851ba42587312368f59092deee5a06 /abuild.in
parentc6609b4739bf45f76360f40c3be2f2b235f728bd (diff)
downloadabuild-1cbc853155b99aa062b1f30dd4d2c29fb9576e20.tar.bz2
abuild-1cbc853155b99aa062b1f30dd4d2c29fb9576e20.tar.xz
abuild: fix checksum update
Fix case where 1) checksum is a single line and 2) there is a variable under the checksum that should be kept. For example: sha512sum="...." keepthis="..." Previously the `keepthis` variable would have been removed. ref https://github.com/alpinelinux/abuild/pull/41
Diffstat (limited to 'abuild.in')
-rw-r--r--abuild.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/abuild.in b/abuild.in
index d52c0bf..8a54061 100644
--- a/abuild.in
+++ b/abuild.in
@@ -2107,9 +2107,13 @@ checksum() {
local s files
[ -z "$source" ] && [ -n "${md5sums}${sha256sums}${sha512sums}" ] \
&& msg "Removing checksums from APKBUILD"
- sed -i -e '/^md5sums="/,/"\$/d; /^md5sums=''/,/''\$/d' "$APKBUILD"
- sed -i -e '/^sha512sums="/,/"\$/d; /^sha512sums=''/,/''\$/d' "$APKBUILD"
- sed -i -e '/^sha256sums="/,/"\$/d; /^sha256sums=''/,/''\$/d' "$APKBUILD"
+ sed -E -i -e '/^(md5|sha[0-9]+)sums=".*[^"]$/,/"$/d' \
+ -e '/^(md5|sha[0-9]+)sums=".*"$/d' \
+ \
+ -e "/^(md5|sha[0-9]+)sums='.*[^']\$/,/'\$/d" \
+ -e "/^(md5|sha[0-9]+)sums='.*'\$/d" \
+ APKBUILD
+
[ -z "$source" ] && return 0
fetch
for s in $source; do