rules.mk: make the locked template available even if flock has not been built yet (fall back to unlocked shell command)
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48414
This commit is contained in:
parent
1e568fd4bc
commit
579e9620c6
1 changed files with 7 additions and 3 deletions
6
rules.mk
6
rules.mk
|
@ -333,12 +333,16 @@ endef
|
||||||
# Execute commands under flock
|
# Execute commands under flock
|
||||||
# $(1) => The shell expression.
|
# $(1) => The shell expression.
|
||||||
# $(2) => The lock name. If not given, the global lock will be used.
|
# $(2) => The lock name. If not given, the global lock will be used.
|
||||||
|
ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),)
|
||||||
define locked
|
define locked
|
||||||
SHELL= \
|
SHELL= \
|
||||||
$(STAGING_DIR_HOST)/bin/flock \
|
flock \
|
||||||
$(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \
|
$(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \
|
||||||
-c '$(subst ','\'',$(1))'
|
-c '$(subst ','\'',$(1))'
|
||||||
endef
|
endef
|
||||||
|
else
|
||||||
|
locked=$(1)
|
||||||
|
endif
|
||||||
|
|
||||||
# Recursively copy paths into another directory, purge dangling
|
# Recursively copy paths into another directory, purge dangling
|
||||||
# symlinks before.
|
# symlinks before.
|
||||||
|
|
Loading…
Reference in a new issue