Subject: [PATCH abuild] Add new lines around the checksums in APKBUILD

From: Wolf <[email-masked]>
Date: Sun, 7 Jun 2020 23:29:50 +0200

In order to make diffs more tidy and the APKBUILD overall more visually
pleasing, new lines are added after opening and before closing quote,
turning

sha512sums="HASH  foo
HASH  bar"

into

sha512sums="
HASH  foo
HASH  bar
"

therefore keeping alignment of file names.
---
 abuild.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/abuild.in b/abuild.in
index 266a7c6..5c5e74f 100644
--- a/abuild.in
+++ b/abuild.in
@@ -2218,11 +2218,12 @@ checksum() {
 	local s files
 	[ -z "$source" ] && [ -n "${md5sums}${sha256sums}${sha512sums}" ] \
 		&& msg "Removing checksums from APKBUILD"
-	sed -E -i -e '/^(md5|sha[0-9]+)sums=".*[^"]$/,/"$/d' \
+	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" \
+		-e "/^(md5|sha[0-9]+)sums='/,/'\$/d" \
 		APKBUILD
 
 	[ -z "$source" ] && return 0
@@ -2236,7 +2237,7 @@ checksum() {
 	sha256sums=
 	sha512sums="$(cd "$srcdir" && sha512sum $files)" \
 		|| die "sha512sum failed"
-	echo "sha512sums=\"$sha512sums\"" >>"$APKBUILD"
+	printf 'sha512sums="\n%s\n"\n' "$sha512sums" >>"$APKBUILD"
 }
 
 rootbld_actions() {
-- 
2.26.2