Hi, 2010/5/31 Marc Kleine-Budde <[email protected]>: > Remy Bohmer wrote: >> Hi, >>> I don't like this. $(KERNEL_CONFIG) may not be readonly on purpose and >>> changes get lost. What about: >>> >>> if diff -q "$(KERNEL_DIR)/.config" "$(<)" > /dev/null; then >>> cp "$(KERNEL_DIR)/.config" "$(<)" >>> fi >>> >>> Then it only fails if there are changes. > > you can also use "cmp -s", which is used in the oldconfig/menuconfig > >> This will not work, since it always changes, even if there is not >> actually made a change at all. >> It changes because the timestamp at the 4th line in the config file >> will be updated on every 'make oldconfig' , resulting in that always a >> difference will be detected. It could only work if a compare is done >> only on the lines that do not start with '#', like this > > The timestamp thing is not true, since ptxdist sets "KCONFIG_NOTIMESTAMP=1"
The timestamp thing is true for users who still run the menuconfig from the kernel tree itself. In that case always a timestamp is listed in the config file, and thus there will always be noticed a difference. I still think it is useful to check if the configs are different while excluding checking for the lines starting with '#' like below. >> if diff -q -I '#' "$(KERNEL_DIR)/.config" "$(<)" > /dev/null; then >> cp "$(KERNEL_DIR)/.config" "$(<)" >> fi shall I provide a new patch for that? Kind regards, Remy -- ptxdist mailing list [email protected]
