1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

Merge pull request #281 from olof/git_version_info

Add git version info to version string
This commit is contained in:
Johan Andersson 2015-10-19 20:02:41 +02:00
commit 580c2a8c9d
2 changed files with 7 additions and 1 deletions

View File

@ -79,7 +79,7 @@ release: $(RELEASE_DIR) release-test
set -e; cd $(RELEASE_DIR) && \
sed -i -re 's/^(LATEST_RELEASE_DATE = ).*/\1$(NEW_RELEASE_DATE)/' Makefile;\
sed -i -re 's/^(__version__ = ).*/\1"$(NEW_RELEASE)"/' lib/svtplay_dl/__init__.py;\
make svtplay-dl; \
make svtplay-dl VERSION=$(NEW_RELEASE); \
git add svtplay-dl Makefile lib/svtplay_dl/__init__.py; \
git commit -m "Prepare for release $(NEW_RELEASE)";
(cd $(RELEASE_DIR) && git format-patch --stdout HEAD^) | git am

View File

@ -18,6 +18,8 @@ export PYFILES = $(sort $(addsuffix /*.py,$(subst .,/,$(PACKAGES))))
PYTHON ?= /usr/bin/env python
VERSION = $(shell git describe 2>/dev/null || $(LATEST_RELEASE)-unknown)
svtplay-dl: $(PYFILES)
@# Verify that there's no .build already \
! [ -d .build ] || { \
@ -32,6 +34,10 @@ svtplay-dl: $(PYFILES)
install $$py .build/$$py; \
done
# Add git version info to __version__, seen in --version
sed -i -e 's/^__version__ = "\([^"]\+\)"$$/__version__ = "$(VERSION)"/' \
.build/svtplay_dl/__init__.py
@# reset timestamps, to avoid non-determinism in zip file
find .build/ -exec touch -m -t 198001010000 {} \;