3 echo "==> Sourcing $pkgbuild ..."
4 unset pkgname pkgver pkgrel license url options md5sums sha1sums sha256sums sha384sums sha512sums
6 echo "==> Package: $pkgname ($pkgver-$pkgrel)"
7 echo " License: $license, Homepage: $url"
12 echo "${options[*]}" |
grep "!$option" >/dev
/null
&& {
13 echo "==> ERROR: $pkgbuild prevents checksum updating using: options=(!$option)"
17 echo "${options[*]}" |
grep "[^!]*$option" >/dev
/null
&& {
18 echo "==> $pkgbuild forces checksum updating using: options=($option)"
21 echo "==> Old checksums:"
22 echo "md5sums=(${md5sums[*]})"
24 checksums
="$(makepkg -p "$pkgbuild" -g)" 2>/dev
/null
25 echo "==> New checksums:"
35 sed -ne '1h;1!H;${;g;s/md5sums=([^)]*)/'$(makepkg -p "$1" -g 2>/dev/null)'/g;p;}' "$1" > "$1.new"
36 #maybe this code should be changed to replace only first occurence of md5sums array...
42 #sed -ne '1h;1!H;${;g;s/md5sums=([^)]*)/'$(makepkg -p "$1" -g 2>/dev/null)'/g;p;}' "$1" > "$1.new"
43 sed -ne '1h;1!H;${;g;s/\(md5\|sha\|sha1\|sha224\|sha256\|sha384\|sha512\)sums=([^)]*)/'$(makepkg -p "$1" -g 2>/dev/null)'/1;p;}' "$1" > "$1.new"
49 sed -i '/^md5sums=([^)]*)/d' PKGBUILD
&& makepkg
-g >> PKGBUILD
&& makepkg
51 sed -ne '1h;1!H;${;g;s/md5sums=([^)]*)/'$(makepkg -g 2>/dev/null)'/g;p;}' PKGBUILD
54 { rm PKGBUILD
; awk '$0 ~ /^md5sums/ {i = 1; system("makepkg -g 2>/dev/null")}; !i {print}; $0 ~ /\)/ {i = 0}' > PKGBUILD
; } < PKGBUILD