From 71a8dcca087f7b3045e14da2209c87378505fd01 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Mon, 8 Apr 2019 15:55:05 +0200 Subject: [PATCH] tool/depot: use nullglob on stale archive removal nullglob is needed to get an empty shell glob in case no matching binary archive (path) exists. Otherwise, the original glob string including the * is returned and used in the for loop. --- tool/depot/mk/extract_src_archive | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool/depot/mk/extract_src_archive b/tool/depot/mk/extract_src_archive index 81be6ee2c..a06213176 100755 --- a/tool/depot/mk/extract_src_archive +++ b/tool/depot/mk/extract_src_archive @@ -44,9 +44,11 @@ DEPOT_SUB_DIR := $(DEPOT_DIR)/$(USER)/src # Customize command executed whenever an archive version is automatically # updated. Whenever the version of a src archive is automatically increased, # make sure that the depot is void of any binary archives matching the new -# version number. +# version number. Note, nullglob is needed in case no matching binary archive +# exists. # -VERSION_UPDATED_CMD = ( cd $(DEPOT_DIR); \ +VERSION_UPDATED_CMD = ( shopt -s nullglob; \ + cd $(DEPOT_DIR); \ for stale in $(USER)/bin/*/$(ARCHIVE)/$(RECIPE_VERSION); do \ echo "removing stale binary archive $$stale"; \ rm -rf $$stale; \