Skip to content

Commit ace4944

Browse files
committed
Fix rust-lang#3225: Incorporate feedback from Graydon.
This is a small follow-up fix to the previous commit: I needed to quote the right-hand side of the definition for the variable MATCHES, to handle the case where there are more than one previously installed libraries in the target directory.
1 parent 25f51ee commit ace4944

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

mk/install.mk

+11-11
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ endif
3838
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
3939
# $(1) is the filename/libname-glob
4040
define INSTALL_LIB
41-
$(if $(filter-out 1,$(words $(wildcard $(LIB_SOURCE_DIR)/$(1)))), \
42-
$(error Aborting install because more than one library matching \
43-
$(1) is present in build tree $(LIB_SOURCE_DIR): \
41+
$(if $(filter-out 1,$(words $(wildcard $(LIB_SOURCE_DIR)/$(1)))), \
42+
$(error Aborting install because more than one library matching \
43+
$(1) is present in build tree $(LIB_SOURCE_DIR): \
4444
$(wildcard $(LIB_SOURCE_DIR)/$(1))))
45-
$(Q)LIB_NAME=$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))); \
46-
MATCHES=$(filter-out %$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))),\
47-
$(wildcard $(LIB_DESTIN_DIR)/$(1))); \
48-
if [ -n "$$MATCHES" ]; then \
49-
echo "Warning, one or libraries matching Rust library '$(1)'" && \
50-
echo " (other than '$$LIB_NAME' itself) already present" && \
51-
echo " at destination $(LIB_DESTIN_DIR):" && \
52-
echo $$MATCHES ; \
45+
$(Q)LIB_NAME="$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1))))"; \
46+
MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))),\
47+
$(wildcard $(LIB_DESTIN_DIR)/$(1)))"; \
48+
if [ -n "$$MATCHES" ]; then \
49+
echo "Warning, one or libraries matching Rust library '$(1)'" && \
50+
echo " (other than '$$LIB_NAME' itself) already present" && \
51+
echo " at destination $(LIB_DESTIN_DIR):" && \
52+
echo $$MATCHES ; \
5353
fi
5454
$(call DO_INSTALL_LIB,$(1))
5555
endef

0 commit comments

Comments
 (0)