Skip to content

Commit

Permalink
Fix #3225: Incorporate feedback from Graydon.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pnkfelix committed Jul 9, 2013
1 parent 25f51ee commit ace4944
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions mk/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ endif
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
# $(1) is the filename/libname-glob
define INSTALL_LIB
$(if $(filter-out 1,$(words $(wildcard $(LIB_SOURCE_DIR)/$(1)))), \
$(error Aborting install because more than one library matching \
$(1) is present in build tree $(LIB_SOURCE_DIR): \
$(if $(filter-out 1,$(words $(wildcard $(LIB_SOURCE_DIR)/$(1)))), \
$(error Aborting install because more than one library matching \
$(1) is present in build tree $(LIB_SOURCE_DIR): \
$(wildcard $(LIB_SOURCE_DIR)/$(1))))
$(Q)LIB_NAME=$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))); \
MATCHES=$(filter-out %$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))),\
$(wildcard $(LIB_DESTIN_DIR)/$(1))); \
if [ -n "$$MATCHES" ]; then \
echo "Warning, one or libraries matching Rust library '$(1)'" && \
echo " (other than '$$LIB_NAME' itself) already present" && \
echo " at destination $(LIB_DESTIN_DIR):" && \
echo $$MATCHES ; \
$(Q)LIB_NAME="$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1))))"; \
MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))),\
$(wildcard $(LIB_DESTIN_DIR)/$(1)))"; \
if [ -n "$$MATCHES" ]; then \
echo "Warning, one or libraries matching Rust library '$(1)'" && \
echo " (other than '$$LIB_NAME' itself) already present" && \
echo " at destination $(LIB_DESTIN_DIR):" && \
echo $$MATCHES ; \
fi
$(call DO_INSTALL_LIB,$(1))
endef
Expand Down

9 comments on commit ace4944

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from graydon
at pnkfelix@ace4944

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging pnkfelix/rust/fsk-guard-against-stale-libraries-issue3225-safeguarded = ace4944 into auto

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnkfelix/rust/fsk-guard-against-stale-libraries-issue3225-safeguarded = ace4944 merged ok, testing candidate = 220a5624

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 9, 2013

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from graydon
at pnkfelix@ace4944

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging pnkfelix/rust/fsk-guard-against-stale-libraries-issue3225-safeguarded = ace4944 into auto

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnkfelix/rust/fsk-guard-against-stale-libraries-issue3225-safeguarded = ace4944 merged ok, testing candidate = 8a7b636

@bors
Copy link
Contributor

@bors bors commented on ace4944 Jul 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 8a7b636

Please sign in to comment.