#!/bin/bash me="$(readlink -f $0)" cd $(dirname "${me}") usage() { >&2 echo 'usage:' >&2 echo ' bumpPython $version $provided_files' exit 1 } if [ $# -le 1 ]; then usage fi pkgbuilds=( $(grep -l 'python>=3' */PKGBUILD) ) pyver=$( printf '%s\n' "$1" | \ cut -d' ' -f2 | \ cut -d. -f1,2 ) pymajor="${pyver%%.*}" pyverupper="${pymajor}.$((${pyver#*.}+1))" shift for pkgbuild in "${pkgbuilds[@]}"; do ./bumpPkgrel -n "${pkgbuild%/PKGBUILD}" $(printf ' -p %s' "$@") sed -i ' s@'"'python>=${pymajor}\.[0-9]\+'@'python>=${pyver}'"'@ s@'"'python<${pymajor}\.[0-9]\+'@'python<${pyverupper}'"'@ ' "${pkgbuild}" cd "${pkgbuild%/*}" ../commit-package cd .. done git commit -m 'recompile all python packages'