Reducing entropy of configuration file, which is introduced by find
utility, by applying sorting to its output.

Find is used here to scan packages and targets subdirectories. Its
output, known for its random ordering, determines the base order of
configuration options. So let's fix that.

Signed-off-by: Sergey Ryazanov <[email protected]>
---
I develop a custom firmware and I keep configuration file along with
sources in repository. I was faced with following situation: after I
modify the configuration by 'make menuconfig', some untouched
configuration options could change its position in the file, what caused
svn to generate very long diff. This patch is the attempt to solve this
situation.

Index: include/scan.mk
===================================================================
--- include/scan.mk     (revision 36502)
+++ include/scan.mk     (working copy)
@@ -39,7 +39,7 @@
 
 $(FILELIST):
        rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-       $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq > $@
+       $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | sort > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
        ( \
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to