From be0a83a3fa58bf0b7099d2ad6172bf320312c1d4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 4 Jul 2019 11:35:22 +0200 Subject: bumpVersion: local-certificates new --- bumpVersion | 87 +++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 25 deletions(-) (limited to 'bumpVersion') 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 -- cgit v1.2.3-70-g09d2