File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed
Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,14 @@ if [ "$container_image" = localhost/builder ]; then
6363 " $container_engine " build -t " $container_image " " $dir "
6464fi
6565
66- repo=" $( ./get_repo) "
67- commit=" $( ./get_commit) "
68- timestamp=" $( ./get_timestamp) "
69- default_version=" $( ./get_version) "
66+ repo=" "
67+ commit=" "
68+ timestamp=" "
69+ default_version=" "
70+ [ -e get_repo ] && repo=" $( ./get_repo) "
71+ [ -e get_commit ] && commit=" $( ./get_commit) "
72+ [ -e get_timestamp ] && timestamp=" $( ./get_timestamp) "
73+ [ -e get_version ] && default_version=" $( ./get_version) "
7074
7175[ -d $target_dir ] || mkdir $target_dir
7276
Original file line number Diff line number Diff line change @@ -15,14 +15,18 @@ prelastword = $(word $(words $1),_ $1)
1515cname_version = $(call lastword,$(subst -, ,$1) )
1616cname_arch = $(call prelastword,$(subst -, ,$1) )
1717
18- define require_var =
19- ifndef $1
20- $$(error '$1 undefined')
18+ ifeq ($(REPO ) ,)
19+ override REPO := http://deb.debian.org/debian
20+ endif
21+ ifeq ($(COMMIT ) ,)
22+ override COMMIT := $(shell [ -z "$$(git status --porcelain 2> /dev/null ) " ] && git rev-parse HEAD 2> /dev/null || echo local)
23+ endif
24+ ifeq ($(TIMESTAMP ) ,)
25+ override TIMESTAMP := 0
26+ endif
27+ ifeq ($(DEFAULT_VERSION ) ,)
28+ override DEFAULT_VERSION := bookworm
2129endif
22- endef
23-
24- required_vars := REPO COMMIT TIMESTAMP DEFAULT_VERSION
25- $(foreach var,$(required_vars),$(eval $(call require_var,$(var))))
2630
2731SHORT_COMMIT := $(shell head -c 8 <<< '$(COMMIT ) ')
2832
You can’t perform that action at this time.
0 commit comments