From b15f6b0dc2a23325b00b195e061334255d03540e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 24 Sep 2018 14:03:57 +0200 Subject: bumpPerl: save current perl version in depends=() --- bumpPerl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'bumpPerl') diff --git a/bumpPerl b/bumpPerl index 5ade81ce5..f16cdff1b 100755 --- a/bumpPerl +++ b/bumpPerl @@ -3,12 +3,41 @@ me="$(readlink -f $0)" cd $(dirname "${me}") +perlMinor=$( + pacman -Q perl | \ + sed ' + s/^\S\+ // + ' +) +perlMajor="${perlMinor%%.*}" +perlMinor="${perlMinor#${perlMajor}.}" +perlMinor="${perlMinor%%.*}" + for pkgbuild in perl-*/PKGBUILD demeter/PKGBUILD; do pkgrel="$( sed -n "/^pkgrel='\?[0-9]\+'\?\$/{s@^pkgrel='\?\([0-9]\+\)'\?\$@\1@;p}" "${pkgbuild}" )" sed -i "s@^\(pkgrel=\)'\?[0-9]\+'\?\$@\1'$[${pkgrel}+1]'@" "${pkgbuild}" + sed -i ' + /^depends=(/{ + :a + /)/! { + N + ba + } + s/\n\(\s*\('"'"'\?\)perl[<>]\S\+\2\n\)\+/\n/ + s/^depends=([^\n]*\n/\0 '"'"'perl>='"${perlMajor}.${perlMinor}'"'\n '"'"'perl<'"${perlMajor}.$((perlMinor+1))'"'\n/ + } + ' "${pkgbuild}" + if ! grep -q '^depends=(' "${pkgbuild}"; then + sed -i ' + /^arch=(/ a depends=(\ + '"'"'perl>='"${perlMajor}.${perlMinor}'"'\ + '"'"'perl<'"${perlMajor}.$((perlMinor+1))'"'\ +) + ' "${pkgbuild}" + fi git add "${pkgbuild}" done -- cgit v1.2.3-70-g09d2