#!/bin/bash if [ $# -eq 0 ] then >&2 echo 'bumping versions of all packages ...' $0 $(ls "$(dirname "$(readlink -f "$0")")"/*/PKGBUILD | sed 's|^.*/\([^/]\+\)/PKGBUILD$|\1|') exit $? elif [ $# -gt 1 ] then err=0 for pkg in "$@" do $0 "${pkg}" cErr=$? [ ${cErr} -gt ${err} ] && err=${cErr} done exit ${err} fi paket="${1%/}" >&2 echo "bumping '${paket}' ..." cd "$(dirname "$(readlink -f "$0")")" [ -r "${paket}/PKGBUILD" ] || exit 1 eval $(./checkVersions -m "${paket}") if [ "${remVer}" == "${pkgver}" ] then >&2 echo '... nothing to do here.' exit 0 fi cd "${paket}" sed 's|pkgver=.*$|pkgver='"${remVer}"'|; s|pkgrel=.*$|pkgrel=1|; s@^\s*\(sha[[:digit:]]\+sums\|md5sums\)=@sha512sums=@; /^\(sha[[:digit:]]\+\|md5\)sums_/d ' -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 rm -rf pkg src sudo pacman -Sy makepkg -fcsr --noconfirm --asdeps || exit 1 namcap ${paket}-${remVer}-1-*.pkg.tar.xz || exit 1 git commit PKGBUILD -m "${paket} ${pkgver} -> ${remVer}" >&2 echo '... done'