diff --git a/Makefile b/Makefile index d971a63a2..ded3d8e00 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,11 @@ shell-check: VERSION: tools/version.sh +bump-python-version: VERSION + tools/bump-python-version.sh + .PHONY: tarball -tarball: VERSION +tarball: VERSION bump-python-version $(MAKE) -C legacy build cd .. && tar -czf libretime-$(shell cat VERSION | tr -d [:blank:]).tar.gz \ --owner=root --group=root \ diff --git a/tools/bump-python-version.sh b/tools/bump-python-version.sh new file mode 100755 index 000000000..763fb0423 --- /dev/null +++ b/tools/bump-python-version.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Bump the version in the setup.py files. + +set -u + +error() { + echo >&2 "error: $*" + exit 1 +} + +command -v sed > /dev/null || error "sed command not found!" + +version="$(cat VERSION)" + +for setup_path in */setup.py; do + sed --in-place \ + "s/version=\".*\",/version=\"$version\",/" \ + "$setup_path" || + error "could not bump version for $setup_path!" +done