Re: [OpenWrt-Devel] [PATCH] Keep /etc/nginx on sysupgrade
Jo-Philipp Wich wrote: It looks like conffiles can only save files, not entire directories. /etc/nginx is a directory. Should conffiles be fixed to work with directories too? It works fine with directories, see include/package-ipkg.mk, the code below ifneq ($$(KEEP_$(1)),) I see. The existing feeds/packages/net/nginx/Makefile already lists the files under /etc/nginx that ship in the package in its conffiles definition, but this doesn't result in a keep file in the package because include/package-ipkg.mk will only add entries to a keep file when they aren't present as files in the package. Is this intentional? The net effect is that changes to conffiles aren't preserved across sysupgrade when default conffiles are present in a package. If that's the case, what's the point of even listing these files in conffiles? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Keep /etc/nginx on sysupgrade
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I see. The existing feeds/packages/net/nginx/Makefile already lists the files under /etc/nginx that ship in the package in its conffiles definition, but this doesn't result in a keep file in the package because include/package-ipkg.mk will only add entries to a keep file when they aren't present as files in the package. ... or when the entry is a directory. But they will get recorded by opkg, which is another source sysupgrade uses to assemble the list of files to get backed up. The sysupgrade list is the distinct union of find -type f $(cat /etc/sysupgrade.conf) find -type f $(cat /lib/upgrade/keep.d/*) opkg list-changed-conffiles Is this intentional? Yey. The net effect is that changes to conffiles aren't preserved across sysupgrade when default conffiles are present in a package. Huh? If that's the case, what's the point of even listing these files in conffiles? The point is: - - Existing file entries in conffiles are tracked by opkg, and opkg list-changed-conffiles is used to only back up actually modified configs during a sysupgrade - - Directory or not existing file entries are added to the keep list so that they're unconditionally backed up during sysupgrade I agree that adding /etc/nginx will overrule the opkg tracking (means files are *always* backed up, even if unchanged, but that is such a minor problem that neither needs fixing nor much discussion about. In any case, simply add /etc/nginx/ to conffiles, it will work as intended and you do not need to ship a custom keep file. ~ Jow -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlA3d/cACgkQdputYINPTPMmdwCfZcvNtg1ogFC2W4haYjYEv4lI 5N0An3egffwxDtaXlo6/1c50OJW/CoZT =BxMq -END PGP SIGNATURE- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Keep /etc/nginx on sysupgrade
Jo-Philipp Wich wrote: But they will get recorded by opkg, which is another source sysupgrade uses to assemble the list of files to get backed up. This is the part I was missing. Thanks for the explanation. I've submitted a v2 patch in case it's thought to be generally useful, otherwise I'll just carry it locally. I also submitted a patch to upgrade nginx 1.2.3 separately a few days ago. That shouldn't be controversial at all. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Keep /etc/nginx on sysupgrade
Jo-Philipp Wich wrote: Hi. You do not need to ship a keep file, it is enough to add /etc/nginx to the conffiles define. It looks like conffiles can only save files, not entire directories. /etc/nginx is a directory. Should conffiles be fixed to work with directories too? ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] Keep /etc/nginx on sysupgrade
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It looks like conffiles can only save files, not entire directories. /etc/nginx is a directory. Should conffiles be fixed to work with directories too? It works fine with directories, see include/package-ipkg.mk, the code below ifneq ($$(KEEP_$(1)),) ~ Jow -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlA1JzsACgkQdputYINPTPM+NwCfWqTOrkFsXlHBbVD+QHgHKw7P NPcAn0U3ISESdEKUdX7qHMCRCe1iNEjq =zkqZ -END PGP SIGNATURE- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] Keep /etc/nginx on sysupgrade
Signed-off-by: Mark Mentovai m...@moxienet.com --- Index: packages/net/nginx/Makefile === --- packages/net/nginx/Makefile (revision 33213) +++ packages/net/nginx/Makefile (working copy) @@ -103,6 +103,8 @@ $(INSTALL_DATA) $(addprefix $(PKG_INSTALL_DIR)/etc/nginx/,$(config_files)) $(1)/etc/nginx/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) ./files/nginx.keep $(1)/lib/upgrade/keep.d/nginx endef $(eval $(call BuildPackage,nginx)) Index: packages/net/nginx/files/nginx.keep === --- packages/net/nginx/files/nginx.keep (revision 0) +++ packages/net/nginx/files/nginx.keep (revision 0) @@ -0,0 +1 @@ +/etc/nginx/ ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel