aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-10-05 19:20:27 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-10-05 19:20:27 +0000
commit0aedfbfd70b6fd71ec89839b94c6554a9e5a1bdd (patch)
tree637210bdd8f8ffe66b0570a87d291ce9ad003265 /include
parent4b56e28bbb65fa31a320899697d8d8037a6f3ce5 (diff)
downloadupstream-0aedfbfd70b6fd71ec89839b94c6554a9e5a1bdd.tar.gz
upstream-0aedfbfd70b6fd71ec89839b94c6554a9e5a1bdd.tar.bz2
upstream-0aedfbfd70b6fd71ec89839b94c6554a9e5a1bdd.zip
[include] 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. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23257 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r--include/package-ipkg.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index a07c5cc38c..512e40186d 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -49,6 +49,7 @@ ifeq ($(DUMP),)
IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
+ KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
ifdef Package/$(1)/install
@@ -112,6 +113,20 @@ ifeq ($(DUMP),)
(cd $$(IDIR_$(1))/CONTROL; \
$($(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)
@[ -f $$(IPKG_$(1)) ]