#!/bin/bash me="$(readlink -f $0)" cd $(dirname "${me}") perlMinor=$( bsdtar -tf /var/lib/pacman/sync/core.db \ | sed -n ' s@^perl-@@ T s@-[0-9]\+/desc$@@ T /^[0-9.]\+$/p ' ) perlMajor="${perlMinor%%.*}" perlMinor="${perlMinor#${perlMajor}.}" perlMinor="${perlMinor%%.*}" provided=$('./liste-verfuegbare-Versionen') || exit $? trap 'rm -f "${provided}"' EXIT for pkgbuild in perl-*/PKGBUILD demeter/PKGBUILD spamassassin-courier/PKGBUILD; do ./bumpPkgrel -n -p "${provided}" "${pkgbuild%/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 cd "${pkgbuild%/*}" ../commit-package cd .. done git commit -m 'recompile all perl packages'