Received: from wolfsden.cz (wolfsden.cz [37.205.8.62])
	by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id C43CF781874
	for <~alpine/devel@lists.alpinelinux.org>; Sun,  7 Jun 2020 21:30:08 +0000 (UTC)
Received: by wolfsden.cz (Postfix, from userid 110)
	id B684C330E85; Sun,  7 Jun 2020 21:30:06 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
	DKIM_ADSP_ALL,URIBL_BLOCKED autolearn=no autolearn_force=no
	version=3.4.2
Received: from localhost (unknown [128.0.188.242])
	by wolfsden.cz (Postfix) with ESMTPSA id 2DF17330E15;
	Sun,  7 Jun 2020 21:30:06 +0000 (UTC)
From: Wolf <wolf@wolfsden.cz>
To: ~alpine/devel@lists.alpinelinux.org
Cc: Wolf <wolf@wolfsden.cz>
Subject: [PATCH abuild] Add new lines around the checksums in APKBUILD
Date: Sun,  7 Jun 2020 23:29:50 +0200
Message-Id: <20200607212950.1078853-1-wolf@wolfsden.cz>
X-Mailer: git-send-email 2.26.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

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