From: nbd Date: Wed, 20 Jan 2016 21:31:38 +0000 (+0000) Subject: rules.mk: make the locked template available even if flock has not been built yet... X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=f44566856e3d8b305ed5862f1cd025a4c89abe43;p=openwrt.git 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 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48414 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/rules.mk b/rules.mk index f0c813620a..11ed80950a 100644 --- a/rules.mk +++ b/rules.mk @@ -333,12 +333,16 @@ endef # Execute commands under flock # $(1) => The shell expression. # $(2) => The lock name. If not given, the global lock will be used. -define locked +ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),) + define locked SHELL= \ - $(STAGING_DIR_HOST)/bin/flock \ + flock \ $(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \ -c '$(subst ','\'',$(1))' -endef + endef +else + locked=$(1) +endif # Recursively copy paths into another directory, purge dangling # symlinks before.