summaryrefslogtreecommitdiff
path: root/bumpVersion
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-07-04 11:35:22 +0200
committerErich Eckner <git@eckner.net>2019-07-04 11:35:22 +0200
commitbe0a83a3fa58bf0b7099d2ad6172bf320312c1d4 (patch)
treeaae13fbda50150783cb7914a11560a0a166e77c9 /bumpVersion
parent45f2b848041764642dc7712b056476316c96c478 (diff)
downloadarchlinuxewe-be0a83a3fa58bf0b7099d2ad6172bf320312c1d4.tar.xz
bumpVersion: local-certificates new
Diffstat (limited to 'bumpVersion')
-rwxr-xr-xbumpVersion87
1 files changed, 62 insertions, 25 deletions
diff --git a/bumpVersion b/bumpVersion
index c798669b4..5cf3e20fe 100755
--- a/bumpVersion
+++ b/bumpVersion
@@ -88,34 +88,71 @@ if [ -z "${remVer}" ]; then
exit 0
fi
+auto_summen=true
+
cd "${paket}"
-sed 's|^\(\s*\)pkgver=.*$|\1pkgver='"${remVer}"'|;
+if [ "${paket}" = 'local-certificates' ]; then
+ sums=$(
+ curl -Ss 'https://eckner.net/certs/sha512sums'
+ )
+ sed_extra='
+ /^source=/ i source=(\
+'"$(
+ printf '%s\n' "${sums}" \
+ | sed '
+ s@^\S\+ @ '"'"'https://eckner.net/certs/@
+ s/$/'"'"'\\/
+ '
+ )"'
+)\
+sha512sums=(\
+'"$(
+ printf '%s\n' "${sums}" \
+ | sed '
+ s/ .*$/'"'"'\\/
+ s/^/ '"'"'/
+ '
+ )"'
+)
+ /^source=/,/)$/ d
+ /^sha512sums=/,/)$/ d
+ '
+ auto_summen=false
+fi
+
+sed -i 's|^\(\s*\)pkgver=.*$|\1pkgver='"${remVer}"'|;
s|^\(\s*\)pkgrel=.*$|\1pkgrel=1|;
- s@^\s*\(sha[[:digit:]]\+sums\|md5sums\)=@sha512sums=@;
- /^\(sha[[:digit:]]\+\|md5\)sums_/d;
-'"${sedExtra}" -i PKGBUILD
-
-sed '
- :begin;
- $!N;
- s@^sha512sums=\([^)]*\)\n\(.*\)$@sha512sums=\1 \2@;
- tbegin;
- P;
- D
-' -i PKGBUILD
-
-summen="$( \
- makepkg -g | \
- sed ':begin;
- $!N;
- s@^\(.*\)\n\(.*\)$@\1\\n\2@;
- tbegin;
- P;
- D
- ' \
-)"
-sed 's|sha512sums=.*$|'"${summen}"'|' -i PKGBUILD
+ '"${sed_extra}"'
+' PKGBUILD
+
+if ${auto_summen}; then
+ sed -i '
+ s@^\s*\(sha[[:digit:]]\+sums\|md5sums\)=@sha512sums=@;
+ /^\(sha[[:digit:]]\+\|md5\)sums_/d;
+ ' PKGBUILD
+
+ sed '
+ :begin;
+ $!N;
+ s@^sha512sums=\([^)]*\)\n\(.*\)$@sha512sums=\1 \2@;
+ tbegin;
+ P;
+ D
+ ' -i PKGBUILD
+
+ summen="$( \
+ makepkg -g | \
+ sed ':begin;
+ $!N;
+ s@^\(.*\)\n\(.*\)$@\1\\n\2@;
+ tbegin;
+ P;
+ D
+ ' \
+ )"
+ sed 's|sha512sums=.*$|'"${summen}"'|' -i PKGBUILD
+fi
(
if ! yes '' | "${myDir}/testeAbhaengigkeiten" "${paket}"; then