When performing sysupgrade process, opkg should report its conffiles
list.

Signed-off-by: Alexey I. Froloff <ra...@altlinux.org>
---
 package/opkg/Makefile                |    2 ++
 package/opkg/files/opkg-conffiles.sh |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 package/opkg/files/opkg-conffiles.sh

diff --git a/package/opkg/Makefile b/package/opkg/Makefile
index 6894ae7..40147ce 100644
--- a/package/opkg/Makefile
+++ b/package/opkg/Makefile
@@ -69,7 +69,9 @@ define Package/opkg/install
        $(INSTALL_DIR) $(1)/usr/lib/opkg
        $(INSTALL_DIR) $(1)/bin
        $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_DIR) $(1)/lib/upgrade
        $(INSTALL_DATA) ./files/opkg.conf $(1)/etc/
+       $(INSTALL_DATA) ./files/opkg-conffiles.sh $(1)/lib/upgrade/
        $(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg.conf
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
 endef
diff --git a/package/opkg/files/opkg-conffiles.sh 
b/package/opkg/files/opkg-conffiles.sh
new file mode 100644
index 0000000..237fd9f
--- /dev/null
+++ b/package/opkg/files/opkg-conffiles.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+add_opkg_conffiles() {
+       local file="$1"
+       local pattern="/usr/lib/opkg/info/*.conffiles"
+       cat $pattern >/dev/null 2>&1 && cat $pattern >>"$file"
+       return 0
+}
+append sysupgrade_init_conffiles add_opkg_conffiles
-- 
1.6.5.8

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to