summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbumpPkgrel2
-rwxr-xr-xbumpPython45
2 files changed, 9 insertions, 38 deletions
diff --git a/bumpPkgrel b/bumpPkgrel
index 2a37a2679..014c6102d 100755
--- a/bumpPkgrel
+++ b/bumpPkgrel
@@ -102,7 +102,7 @@ if [ $# -ne 1 ] || ${auto_detect}; then
d
' \
| grep -qvxF "python>=${python_version}"; then
- "${0%/*}/bumpPython" 3 "${python_version}"
+ "${0%/*}/bumpPython" "${python_version}" "${provided}"
fi
fi
diff --git a/bumpPython b/bumpPython
index 940be2150..93f30bc40 100755
--- a/bumpPython
+++ b/bumpPython
@@ -5,58 +5,29 @@ cd $(dirname "${me}")
usage() {
>&2 echo 'usage:'
- >&2 echo ' bumpPython 2 [$version]'
- >&2 echo 'or:'
- >&2 echo ' bumpPython 3 [$version]'
+ >&2 echo ' bumpPython $version $provided_files'
exit 1
}
-if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+if [ $# -le 1 ]; then
usage
fi
-case "$1" in
-
- '2')
- pkgbuilds=(
- $(grep -l 'python>=2' */PKGBUILD)
- )
- if [ $# -eq 1 ]; then
- pyver=$(
- python2 --version 2>&1
- )
- else
- pyver="$2"
- fi
- ;;
- '3')
- pkgbuilds=(
- $(grep -l 'python>=3' */PKGBUILD)
- )
- if [ $# -eq 1 ]; then
- pyver=$(
- python --version 2>&1
- )
- else
- pyver="$2"
- fi
- ;;
- *)
- usage
- ;;
-esac
-
+pkgbuilds=(
+ $(grep -l 'python>=3' */PKGBUILD)
+)
pyver=$(
- printf '%s\n' "${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}"
+ ./bumpPkgrel -n "${pkgbuild%/PKGBUILD}" $(printf ' -p %s' "$@")
sed -i '
s@'"'python>=${pymajor}\.[0-9]\+'@'python>=${pyver}'"'@
s@'"'python<${pymajor}\.[0-9]\+'@'python<${pyverupper}'"'@