package-ipkg.mk: build sysupgrade keepfile hints out of conffiles not yet present in the package. This applies to config directories or files that do not exist but may be created by the user after package installation.

SVN-Revision: 23257
This commit is contained in:
Jo-Philipp Wich 2010-10-05 19:20:27 +00:00
parent 3341e1ece7
commit f3a5085903
1 changed files with 15 additions and 0 deletions

View File

@ -49,6 +49,7 @@ ifeq ($(DUMP),)
IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1) IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT)) ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
ifdef Package/$(1)/install ifdef Package/$(1)/install
@ -112,6 +113,20 @@ ifeq ($(DUMP),)
(cd $$(IDIR_$(1))/CONTROL; \ (cd $$(IDIR_$(1))/CONTROL; \
$($(1)_COMMANDS) \ $($(1)_COMMANDS) \
) )
ifneq ($$(KEEP_$(1)),)
@( \
keepfiles=""; \
for x in $$(KEEP_$(1)); do \
[ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
done; \
[ -z "$keepfiles" ] || { \
mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
}; \
)
endif
$(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR) $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
@[ -f $$(IPKG_$(1)) ] @[ -f $$(IPKG_$(1)) ]