Packaging keep.d/ files and include/package-ipkg.mk

Philip Prindeville philipp_subx at redfish-solutions.com
Sat Apr 22 15:28:17 PDT 2023


Hi,

This question is for Jo-Philipp or whomever else wants to take a stab at it.  I'm looking at this commit:

https://github.com/openwrt/openwrt/commit/f3a5085903f770bf0b569d3b94ca1cc4d7bab53f#diff-327b383b4b87cd4627eea84a61ada9688b7438baf11536eb74951e4479adb84dR116-R129


And specifically this part:


   	keepfiles=""; \
	for x in $$(KEEP_$(1)); do \
		[ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
	done; \


Which seems to me to say "add the lines from KEEP_$(1) only if the line is a directory or names a non-existent file" (i.e. anything other than an existent file).

Whereas the comment says:


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.


And I'm wondering... why not just add the lines regardless?

If you look at:

https://github.com/openwrt/openwrt/blob/master/package/base-files/Makefile#L48-L71

And:

https://github.com/openwrt/openwrt/blob/master/package/base-files/files/lib/upgrade/keep.d/base-files-essential

You'll see a fair amount of duplication.  But if we just used the contents of $(Package/base-files/conffiles) as-is, then package/base-files/files/lib/upgrade/keep.d/base-files-essential could just go away.

What am I missing here?

Thanks.

-Philip




More information about the openwrt-devel mailing list