diff options
author | Erich Eckner <git@eckner.net> | 2018-09-24 14:03:57 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-24 14:03:57 +0200 |
commit | b15f6b0dc2a23325b00b195e061334255d03540e (patch) | |
tree | 1978854ed32cbb6c26be5a7aebb36859fc86f444 | |
parent | 4156e0f5edf9f99529a591fb9757b442a9685f46 (diff) | |
download | archlinuxewe-b15f6b0dc2a23325b00b195e061334255d03540e.tar.xz |
bumpPerl: save current perl version in depends=()
-rwxr-xr-x | bumpPerl | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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 |