build: merge bump-version.sh into local makefile

We already have a makefile for maintenance work. Merge the
`bump-version.sh` script into `Makefile` as a new target so we avoid
placing scripts spread around the repository.

While at it, this commit also uses immediate assignment for
shell-evaluated make variables. This ensures the shell commands are
only executed once, and then are guaranteed to be of the same value for
the remainder of the execution.
This commit is contained in:
David Rheinsberg 2020-03-02 21:24:25 +01:00 committed by msehnout
parent adc3465879
commit d379cc1a6f
2 changed files with 8 additions and 10 deletions

View file

@ -1,7 +1,8 @@
PACKAGE_NAME = osbuild
VERSION = $$(python3 setup.py --version)
VERSION := $(shell python3 setup.py --version)
NEXT_VERSION := $(shell expr "$(VERSION)" + 1)
.PHONY: sdist tarball srpm rpm copy-rpms-to-test check-working-directory vagrant-test vagrant-test-keep-running
.PHONY: sdist tarball srpm rpm copy-rpms-to-test check-working-directory vagrant-test vagrant-test-keep-running bump-version
sdist:
python3 setup.py sdist
@ -51,3 +52,8 @@ vagrant-test-keep-running: check-working-directory copy-rpms-to-test
- $(MAKE) -C test up
- $(MAKE) -C test install-deps
$(MAKE) -C test run-tests-remotely
bump-version:
sed -i "s|Version:\s*$(VERSION)|Version:\\t$(NEXT_VERSION)|" osbuild.spec
sed -i "s|Release:\s*[[:digit:]]\+|Release:\\t1|" osbuild.spec
sed -i "s|version=\"$(VERSION)\"|version=\"$(NEXT_VERSION)\"|" setup.py