Commit 9bd30ca 1 parent 86e3a9f commit 9bd30ca Copy full SHA for 9bd30ca
File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ PYTHON ?= /usr/bin/python3
4
4
OS_CODENAME ?= $(shell grep VERSION_CODENAME= /etc/os-release | cut -f2 -d=)
5
5
6
6
ifneq ("$(wildcard .git) ","")
7
- COMMIT ?= $(or $(shell git rev-parse HEAD) , local)
8
- VERSION ?= $(or $(shell $(PYTHON ) ./version.py $(shell git show -s --format="% ct" $(shell git rev-parse HEAD) ) $(shell git rev-parse --abbrev-ref HEAD) ) , 0.0.0)
9
- SOURCE_DATE_EPOCH ?= $(or $(shell git show -s --format="% ct" $(shell git rev-parse HEAD) ) , $(shell date "+% s") )
7
+ RELEASE ?= $(shell git describe --all --match master --match 'release-* ' --abbrev=0 HEAD | sed 's#heads/##g')
8
+ COMMIT ?= $(shell git rev-parse HEAD)
9
+ SOURCE_DATE_EPOCH ?= $(or $(shell git show -s --format="% ct" $(COMMIT ) ) , $(shell date "+% s") )
10
+ VERSION ?= $(shell $(PYTHON ) ./version.py $(SOURCE_DATE_EPOCH ) $(RELEASE ) )
10
11
else
11
- COMMIT ?= local
12
- VERSION ?= 0.0.0
12
+ COMMIT ?= release
13
13
SOURCE_DATE_EPOCH ?= $(shell date "+% s")
14
+ VERSION ?= $(or $(shell basename $(PWD ) | grep -E -o '[0-9]+.[0-9]+(.[0-9]+) ?$') , 0.0.0)
14
15
endif
15
16
16
17
ENV ?= $(PWD ) /env
@@ -26,6 +27,9 @@ _CFLAGS := $(CFLAGS) -Wall -O2 -fno-strict-aliasing -DWFB_VERSION='"$(VERSION)-$
26
27
27
28
all : all_bin gs.key test
28
29
30
+ version :
31
+ @echo -e " RELEASE=$( RELEASE) \nCOMMIT=$( COMMIT) \nVERSION=$( VERSION) \nSOURCE_DATE_EPOCH=$( SOURCE_DATE_EPOCH) "
32
+
29
33
$(ENV ) :
30
34
$(PYTHON ) -m virtualenv --download $(ENV )
31
35
$$(PATH=$(ENV ) /bin:$(ENV ) /local/bin:$(PATH ) which python3 ) -m pip install --upgrade pip setuptools $(STDEB )
You can’t perform that action at this time.
0 commit comments