mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Improve Makefile for release version numbers
* Improve the pattern to leave tagged release version numbers like `0.2.2-alpha` alone and only increase version numbers where git describe has added a string starting with a number.
This commit is contained in:
parent
4d7538db41
commit
d8d6eb3f43
1 changed files with 3 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -45,8 +45,9 @@ GITDESC := $(shell git describe)
|
|||
GITDESCPATCH := $(shell echo '$(GITDESC)' | sed -E 's/v?[0-9]+\.[0-9]+\.([0-9]+)[-+]?.*/\1/')
|
||||
SEMVERPATCH := $(shell echo $$(( $(GITDESCPATCH) + 1 )))
|
||||
# Hint: The regexp in the next line only matches if there is a hyphen (`-`)
|
||||
# and we can assume that git describe has added a string after the tag
|
||||
SEMVER := $(shell echo '$(GITDESC)' | sed -E 's/v?([0-9]+\.[0-9]+\.)([0-9]+)(-.*)/\1$(SEMVERPATCH)\3/' )
|
||||
# followed by a number, by which we assume that git describe
|
||||
# has added a string after the tag
|
||||
SEMVER := $(shell echo '$(GITDESC)' | sed -E 's/v?([0-9]+\.[0-9]+\.)([0-9]+)(-[1-9].*)/\1$(SEMVERPATCH)\3/' )
|
||||
testsemver:
|
||||
@echo from \'$(GITDESC)\' transformed to \'$(SEMVER)\'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue