Skip to content

Commit

Permalink
fix for #5163
Browse files Browse the repository at this point in the history
- rework fix "Copy and merge var and target/var to $(STAGING_DIR)/var"
  • Loading branch information
hgy59 committed Apr 19, 2022
1 parent 1a7cb4e commit 1315c7f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mk/spksrc.copy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ copy_target: SHELL:=/bin/bash
copy_target: $(PRE_COPY_TARGET) $(INSTALL_PLIST)
ifeq ($(call version_ge, ${TCVERSION}, 7.0),1)
@$(MSG) [DSM7+] Copy target to staging, discard var directory
@(mkdir -p $(STAGING_DIR) && cd $(INSTALL_DIR)/$(INSTALL_PREFIX) && tar cpf - `cat $(INSTALL_PLIST) | sed -e '/^.*:var\/.*/d' -e 's/^.*://g'`) | \
@(mkdir -p $(STAGING_DIR) && cd $(INSTALL_DIR)/$(INSTALL_PREFIX) && tar cpf - $$(cat $(INSTALL_PLIST) | sed -e '/^.*:var\/.*/d' -e 's/^.*://g')) | \
tar xpf - -C $(STAGING_DIR)
@$(MSG) "[DSM7+] Copy and merge var and target/var to $(STAGING_DIR)/var"
@if [ "`cat $(INSTALL_PLIST) | sed -n 's?^.*:var/??p'`" ] ; then \
@if [ "$$(cat $(INSTALL_PLIST) | sed -n 's?^.*:var/??p')" ] ; then \
mkdir -p $(STAGING_DIR)/var ; \
(cd $(INSTALL_DIR)/$(INSTALL_PREFIX)/../var && tar cpf - $$(eval ls -d $$(cat $(INSTALL_PLIST) | sed -n 's?^.*:var/??p') 2>/dev/null)) | tar xpf - -C $(STAGING_DIR)/var ; \
(cd $(INSTALL_DIR)/$(INSTALL_PREFIX)/var && tar cpf - $$(eval ls -d $$(cat $(INSTALL_PLIST) | sed -n 's?^.*:var/??p') 2>/dev/null)) | tar xpf - -C $(STAGING_DIR)/var ; \
([ -d $(INSTALL_DIR)/$(INSTALL_PREFIX)/../var ] && (cd $(INSTALL_DIR)/$(INSTALL_PREFIX)/../var && tar cpf - $$(eval ls -d $$(cat $(INSTALL_PLIST) | sed -n 's?^.*:var/??p') 2>/dev/null)) | tar xpf - -C $(STAGING_DIR)/var) || true ; \
([ -d $(INSTALL_DIR)/$(INSTALL_PREFIX)/var ] && (cd $(INSTALL_DIR)/$(INSTALL_PREFIX)/var && tar cpf - $$(eval ls -d $$(cat $(INSTALL_PLIST) | sed -n 's?^.*:var/??p') 2>/dev/null)) | tar xpf - -C $(STAGING_DIR)/var) || true ; \
fi
else
@$(MSG) Copy target to staging [DSM6]
@(mkdir -p $(STAGING_DIR) && cd $(INSTALL_DIR)/$(INSTALL_PREFIX) && tar cpf - `cat $(INSTALL_PLIST) | cut -d':' -f2`) | \
tar xpf - -C $(STAGING_DIR)
@(mkdir -p $(STAGING_DIR) && cd $(INSTALL_DIR)/$(INSTALL_PREFIX) && tar cpf - $$(cat $(INSTALL_PLIST) | cut -d':' -f2)) | tar xpf - -C $(STAGING_DIR)
endif

post_copy_target: $(COPY_TARGET)
Expand Down

0 comments on commit 1315c7f

Please sign in to comment.