~alpine/devel

abuild: Add new lines around the checksums in APKBUILD v1 PROPOSED

Wolf: 1
 Add new lines around the checksums in APKBUILD

 1 files changed, 4 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/devel/patches/3337/mbox | git am -3
Learn more about email & git

[PATCH abuild] Add new lines around the checksums in APKBUILD Export this patch

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
Hello,

could I get some feedback on this patch?



Thank you,
W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
View this thread in the archives