diff --git a/tool/depot/extract b/tool/depot/extract index f0fc8cec08..eaeba04023 100755 --- a/tool/depot/extract +++ b/tool/depot/extract @@ -39,9 +39,14 @@ define HELP_MESSAGE UPDATE_VERSIONS=1 Automatically increase the version of recipe hash files whenever their respective archive content has changed. The versions are named - after the current date, suffixed with a single - letter to differentiate multiple versions - created on the same day. + after the output of the VERSION_CMD, suffixed + with a single letter in case VERSION_CMD would + return the same version the archive already + has. + + VERSION_CMD= The script whose output is used in case the + archive version needs to be updated. The default + is to use the current date. endef diff --git a/tool/depot/mk/extract.inc b/tool/depot/mk/extract.inc index e46b3b2701..07f502230a 100644 --- a/tool/depot/mk/extract.inc +++ b/tool/depot/mk/extract.inc @@ -138,7 +138,7 @@ suffixed_version = $1$(if $(call suffix_from_list,$2),-$(call suffix_from_list,$ _string_higher_than = $(filter-out $(firstword $(sort $1 $2)),$1) _higher_string = $(if $(call _string_higher_than,$1,$2),$1,$2) -CURRENT_DATE = $(strip $(shell date --iso-8601)) +VERSION_CMD ?= $(strip $(shell date --iso-8601)) _version_higher_than_recipe = $(call _string_higher_than,\ $(call suffixed_version,$1,$2),$(RECIPE_VERSION)) @@ -151,7 +151,7 @@ _next_version = $(eval FOUND := $(if $(call _version_higher_than_recipe,$1,$2),\ $(eval FOUND := $(call suffixed_version,$1,$2 $C)))))\ $(if $(FOUND),$(FOUND),$(addsuffix -x,$(RECIPE_VERSION))) -next_version = $(strip $(call _next_version,$(CURRENT_DATE))) +next_version = $(strip $(call _next_version,$(VERSION_CMD))) # # Message presented to the user whenever a recipe hash is out of date