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.
This commit is contained in:
@@ -44,9 +44,11 @@ DEPOT_SUB_DIR := $(DEPOT_DIR)/$(USER)/src
|
|||||||
# Customize command executed whenever an archive version is automatically
|
# Customize command executed whenever an archive version is automatically
|
||||||
# updated. Whenever the version of a src archive is automatically increased,
|
# 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
|
# 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 \
|
for stale in $(USER)/bin/*/$(ARCHIVE)/$(RECIPE_VERSION); do \
|
||||||
echo "removing stale binary archive $$stale"; \
|
echo "removing stale binary archive $$stale"; \
|
||||||
rm -rf $$stale; \
|
rm -rf $$stale; \
|
||||||
|
|||||||
Reference in New Issue
Block a user