From 17bf2564fa525c2369bb4514d7ae4aa9ec8e9fb6 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 13 Dec 2017 12:12:08 +0100 Subject: [PATCH] depot: improved args check in dependencies tool This patch lets the dependencies tool give better feedback to the user whenever an argument lacks the needed version information. --- tool/depot/dependencies | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tool/depot/dependencies b/tool/depot/dependencies index 06800b32bd..3e0955d061 100755 --- a/tool/depot/dependencies +++ b/tool/depot/dependencies @@ -46,13 +46,32 @@ include $(GENODE_DIR)/tool/depot/mk/dependencies.inc # -# Print gathered information +# Validate and print gathered information # -NEEDED_ARCHIVES := $(foreach TYPE,pkg src raw api bin,${ARCHIVES(${TYPE})}) +# select function for determining the archive version depending on archive type +_archive_version(bin) = bin_archive_version +_archive_version(src) = archive_version +_archive_version(api) = archive_version +_archive_version(raw) = archive_version +_archive_version(pkg) = archive_version + +_version_defined = ${call ${_archive_version(${call archive_type,$1})},$1} + +NEEDED_ARCHIVES := $(foreach TYPE,pkg src raw api bin,${ARCHIVES(${TYPE})}) + +# check for completeness of archive-path arguments +NO_VERSION_ARCHIVES := $(sort $(foreach A,$(NEEDED_ARCHIVES),\ + $(if $(call _version_defined,$A),,$A))) + +# check for existence of archive paths in depot MISSING_ARCHIVES := $(sort $(foreach A,$(NEEDED_ARCHIVES),\ $(if $(wildcard $(addprefix $(DEPOT_DIR)/,$A)),,$A))) checked_completeness: +ifneq ($(NO_VERSION_ARCHIVES),) + @echo "Error: version not specified:"; \ + for i in $(NO_VERSION_ARCHIVES); do echo " $$i"; done; false +endif ifneq ($(MISSING_ARCHIVES),) @echo "Error: incomplete or missing archives:"; \ for i in $(MISSING_ARCHIVES); do echo " $$i"; done; false