diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-05-23 11:37:12 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-05-23 11:39:13 +0200 |
commit | 5127cb76e5905cd55a30a9dad36c10fcb25e9641 (patch) | |
tree | 5e1a307b3b052de5d0919b287bbc392e5cbee924 | |
parent | 383d326685abaa4f722922305920c73e2eee6181 (diff) |
make gbuild deliver more robust in when using HARDLINK
-rw-r--r-- | solenv/gbuild/Deliver.mk | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk index 79e40414b516..9be20ac028bf 100644 --- a/solenv/gbuild/Deliver.mk +++ b/solenv/gbuild/Deliver.mk @@ -31,7 +31,12 @@ gb_Deliver_GNUCOPY := $(GNUCOPY) # if ($true) then old files will get removed from the target location before # they are copied there. In multi-user environments, this is needed you need to # be the owner of the target file to be able to modify timestamps +ifeq ($(strip gb_Deliver_HARDLINK),) gb_Deliver_CLEARONDELIVER := $(false) +else +gb_Deliver_CLEARONDELIVER := $(true) +endif + define gb_Deliver_init gb_Deliver_DELIVERABLES := @@ -54,15 +59,17 @@ endif endef -ifeq ($(strip $(gb_Deliver_GNUCOPY)),) define gb_Deliver__deliver $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) $(if $(gb_Deliver_HARDLINK),ln,cp -P -f) $(1) $(2) && touch -r $(1) $(2) endef -else + +ifneq ($(strip $(gb_Deliver_GNUCOPY)),) +ifeq ($(strip $(gb_Deliver_HARDLINK)),) define gb_Deliver__deliver -$(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) $(if $(gb_Deliver_HARDLINK),--link) --no-dereference --force --preserve=timestamps $(1) $(2) +$(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) --no-dereference --force --preserve=timestamps $(1) $(2) endef endif +endif define gb_Deliver_deliver $(if $(1),$(call gb_Deliver__deliver,$(1),$(2)),\ |