Re: [OpenWrt-Devel] [PATCH][include] Reduce configuration file entropy

2013-05-03 Thread Sergey Ryazanov
2013/5/1 Matthias Buecher / Germany :
>> -   $(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 > $@
>
> What about `sort -u` instead of `uniq | sort` ?
>

Sorry for the delayed reply and thanks for comment. Will fix and send v2.

--
BR,
Sergey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][include] Reduce configuration file entropy

2013-05-01 Thread Matthias Buecher / Germany

On 01.05.2013 01:21, Jonh Wendell wrote:
> didn't try the patch, but I'm all for it, as it fixes a really annoying
> behavior.
> 
> 
> 2013/4/30 Sergey Ryazanov  >
> 
> 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  >
> ---
> 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 > $@

What about `sort -u` instead of `uniq | sort` ?

>  $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
> ( \
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH][include] Reduce configuration file entropy

2013-04-30 Thread Jonh Wendell
didn't try the patch, but I'm all for it, as it fixes a really annoying
behavior.


2013/4/30 Sergey Ryazanov 

> 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 
> ---
> 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
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>



-- 
Jonh Wendell
http://www.bani.com.br
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH][include] Reduce configuration file entropy

2013-04-30 Thread Sergey Ryazanov
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 
---
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
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel