deal with 3 digit releases

This commit is contained in:
Gordon Williams 2018-09-28 10:16:09 +01:00
parent fc6d8222bf
commit 42fa17a860
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ endif
ifndef ALT_RELEASE ifndef ALT_RELEASE
# Default release labeling. (This may fail and give inconsistent results due to the fact that # Default release labeling. (This may fail and give inconsistent results due to the fact that
# travis does a shallow clone.) # travis does a shallow clone.)
LATEST_RELEASE=$(shell git tag | grep RELEASE_ | sort | tail -1) LATEST_RELEASE=$(shell git tag | grep RELEASE_ | sort -n -t V -k 2,2 | tail -1)
# use egrep to count lines instead of wc to avoid whitespace error on Mac # use egrep to count lines instead of wc to avoid whitespace error on Mac
COMMITS_SINCE_RELEASE=$(shell git log --oneline $(LATEST_RELEASE)..HEAD | egrep -c .) COMMITS_SINCE_RELEASE=$(shell git log --oneline $(LATEST_RELEASE)..HEAD | egrep -c .)
ifneq ($(COMMITS_SINCE_RELEASE),0) ifneq ($(COMMITS_SINCE_RELEASE),0)

View File

@ -408,7 +408,7 @@ def get_version():
alt_release = os.getenv("ALT_RELEASE") alt_release = os.getenv("ALT_RELEASE")
if alt_release == None: if alt_release == None:
# Default release labeling based on commits since last release tag # Default release labeling based on commits since last release tag
latest_release = subprocess.check_output('git tag | grep RELEASE_ | sort | tail -1', shell=True).strip() latest_release = subprocess.check_output('git tag | grep RELEASE_ | sort -n -t V -k 2,2 | tail -1', shell=True).strip()
commits_since_release = subprocess.check_output('git log --oneline '+latest_release.decode("utf-8")+'..HEAD | wc -l', shell=True).decode("utf-8").strip() commits_since_release = subprocess.check_output('git log --oneline '+latest_release.decode("utf-8")+'..HEAD | wc -l', shell=True).decode("utf-8").strip()
else: else:
# Alternate release labeling with fork name (in ALT_RELEASE env var) plus branch # Alternate release labeling with fork name (in ALT_RELEASE env var) plus branch