Add new lines around the checksums in APKBUILD

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.
This commit is contained in:
Wolf 2020-06-07 23:29:50 +02:00 committed by Natanael Copa
parent f92b56d8c9
commit f523aabce3

View File

@ -2248,11 +2248,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
@ -2266,7 +2267,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() {