tools: add a directory to contain usefull user-facing tools
v4 cover tools: add a directory to contain usefull user-facing tools
Hello All!
Currently, we provide a few user-facing utilities, like get-developers, in support/scripts/ . But this directory also contains internal scripts that a user should not be directly concerned with. Besides, it is two-level deep in the hierarchy, which is not really nice.
So, we introduce tools/ as a top-level directory, with the goal to store and expose all user-facing utilities, while keeping our internal scripts in support/scripts/ .
The last patch in the series introduces a new utility, brmake, a wrapper around make that stores all the output to a log file and displays only the >>> lines.
Changes v3 -> v4:
- drop legacy symlinks (Thomas)
- reorder series (Thomas, Arnout)
- drop options parsing in brmake (Arnout, Samuel)
- drop moving xorg-release (Thomas)
Changes v2 -> v3:
- rename readme file (Arnout, Thomas)
- fix DEVELOPPERS (Ricardo)
Changes v1 -> v2:
- rename contrib -> tools (Arnout)
- move more scripts
Regards,
Yann E. MORIN.
The following changes since commit 9bb306bd6411071cd07529923b825627502c794d
support/testing: large timeout for login prompt (2017-07-01 16:05:14 +0200)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to 99c3ef336521def728a1e5d80da5d7de7fd3fac1
tools: new tool to filter the output of make (2017-07-01 16:26:12 +0200)
----------------------------------------------------------------
Yann E. MORIN (7):
tools: move test-pkg out of support/scripts
tools: move get-developers out of support/scripts/
tools: move check-package out of support/scripts/
tools: move size-stat-compare out of support/scripts/
tools: move scancpan out of support/scripts/
tools: move scanpypi out of support/scripts/
tools: new tool to filter the output of make
DEVELOPERS | 3 +-
docs/manual/adding-packages-tips.txt | 12 +++----
docs/manual/contribute.txt | 2 +-
docs/manual/writing-rules.txt | 5 +--
support/scripts/pkg-stats | 2 +-
tools/brmake | 37 ++++++++++++++++++++
{support/scripts => tools}/check-package | 2 +-
.../scripts => tools}/checkpackagelib/__init__.py | 0
{support/scripts => tools}/checkpackagelib/base.py | 2 +-
{support/scripts => tools}/checkpackagelib/lib.py | 2 +-
.../checkpackagelib/lib_config.py | 2 +-
.../scripts => tools}/checkpackagelib/lib_hash.py | 2 +-
.../scripts => tools}/checkpackagelib/lib_mk.py | 2 +-
.../scripts => tools}/checkpackagelib/lib_patch.py | 2 +-
.../scripts => tools}/checkpackagelib/readme.txt | 10 +++---
{support/scripts => tools}/get-developers | 0
{support/scripts => tools}/getdeveloperlib.py | 0
tools/readme.txt | 40 ++++++++++++++++++++++
{support/scripts => tools}/scancpan | 0
{support/scripts => tools}/scanpypi | 0
{support/scripts => tools}/size-stats-compare | 0
{support/scripts => tools}/test-pkg | 0
22 files changed, 102 insertions(+), 23 deletions(-)
create mode 100755 tools/brmake
rename {support/scripts => tools}/check-package (98%)
rename {support/scripts => tools}/checkpackagelib/__init__.py (100%)
rename {support/scripts => tools}/checkpackagelib/base.py (78%)
rename {support/scripts => tools}/checkpackagelib/lib.py (95%)
rename {support/scripts => tools}/checkpackagelib/lib_config.py (98%)
rename {support/scripts => tools}/checkpackagelib/lib_hash.py (96%)
rename {support/scripts => tools}/checkpackagelib/lib_mk.py (99%)
rename {support/scripts => tools}/checkpackagelib/lib_patch.py (96%)
rename {support/scripts => tools}/checkpackagelib/readme.txt (91%)
rename {support/scripts => tools}/get-developers (100%)
rename {support/scripts => tools}/getdeveloperlib.py (100%)
create mode 100644 tools/readme.txt
rename {support/scripts => tools}/scancpan (100%)
rename {support/scripts => tools}/scanpypi (100%)
rename {support/scripts => tools}/size-stats-compare (100%)
rename {support/scripts => tools}/test-pkg (100%)Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 1/7 tools: move test-pkg out of support/scripts
Move it to the top-level tools/ directory, so that it is easier to find for users.
Add a legacy symlink for those users who already used them, so as not to break their habits.
---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)
---
docs/manual/adding-packages-tips.txt | 12 ++++++------
tools/readme.txt | 8 ++++++++
{support/scripts => tools}/test-pkg | 0
3 files changed, 14 insertions(+), 6 deletions(-)
create mode 100644 tools/readme.txt
rename {support/scripts => tools}/test-pkg (100%)docs/manual/adding-packages-tips.txt +6 -6
@@ -45,9 +45,9 @@ continuously test random configurations. However, these only build the `master` branch of the git tree, and your new fancy package is not yet there. -Buildroot provides a script in +support/scripts/test-pkg+ that uses the -same base configurations as used by the autobuilders so you can test -your package in the same conditions. +Buildroot provides a script in +tools/test-pkg+ that uses the same base +configurations as used by the autobuilders so you can test your package +in the same conditions. First, create a config snippet that contains all the necessary options needed to enable your package, but without any architecture or toolchain
@@ -74,7 +74,7 @@ Then run the +test-pkg+ script, by telling it what config snippet to use and what package to test: ---- -$ ./support/scripts/test-pkg -c libcurl.config -p libcurl +$ ./tools/test-pkg -c libcurl.config -p libcurl ---- This will try to build your package against all the toolchains used
@@ -83,7 +83,7 @@ too long to do so). The output lists all toolchains and the corresponding result (excerpt, results are fake): ---- -$ ./support/scripts/test-pkg -c libcurl.config -p libcurl +$ ./tools/test-pkg -c libcurl.config -p libcurl armv5-ctng-linux-gnueabi [ 1/11]: OK armv7-ctng-linux-gnueabihf [ 2/11]: OK br-aarch64-glibc [ 3/11]: SKIPPED
@@ -124,7 +124,7 @@ The +test-pkg+ script accepts a few options, for which you can get some help by running: ---- -$ ./support/scripts/test-pkg -h +$ ./tools/test-pkg -h ---- [[github-download-url]]
tools/readme.txt new file +8 -0
@@ -0,0 +1,8 @@ +This directory contains various useful scripts and tools for working +with Buildroot. You need not add this directory in your PATH to use +any of those tools, but you may do so if you want. + +test-pkg + a script that tests a specific package against a set of various + toolchains, with the goal to detect toolchain-related dependencies + (wchar, threads...)
tools/test-pkg renamed from support/scripts/test-pkg +0 -0
Signature · 1 line
2.11.0
PATCH v4 2/7 tools: move get-developers out of support/scripts/
In reply to Yann E. MORINMove it to the top-level tools/ directory, so that it is easier to find for users.
Add a legacy symlink for those users who already used them, so as not to break their habits.
---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)
---
docs/manual/contribute.txt | 2 +-
{support/scripts => tools}/get-developers | 0
{support/scripts => tools}/getdeveloperlib.py | 0
tools/readme.txt | 5 +++++
4 files changed, 6 insertions(+), 1 deletion(-)
rename {support/scripts => tools}/get-developers (100%)
rename {support/scripts => tools}/getdeveloperlib.py (100%)docs/manual/contribute.txt +1 -1
@@ -295,7 +295,7 @@ information). This tool reads your patches and outputs the appropriate +git send-email+ command to use: --------------------- -$ ./support/scripts/get-developers outgoing/* +$ ./tools/get-developers outgoing/* --------------------- Use the output of +get-developers+ to send your patches:
tools/get-developers renamed from support/scripts/get-developers +0 -0
tools/getdeveloperlib.py renamed from support/scripts/getdeveloperlib.py +0 -0
tools/readme.txt +5 -0
@@ -2,6 +2,11 @@ This directory contains various useful scripts and tools for working with Buildroot. You need not add this directory in your PATH to use any of those tools, but you may do so if you want. +get-developpers + a script to return the list of people interested in a specific part + of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as + input, a package name or and architecture name. + test-pkg a script that tests a specific package against a set of various toolchains, with the goal to detect toolchain-related dependencies
Signature · 1 line
2.11.0
PATCH v4 3/7 tools: move check-package out of support/scripts/
In reply to Yann E. MORINMove it to the top-level tools/ directory, so that it is easier to find for users.
Add a legacy symlink for those users who already used them, so as not to break their habits.
---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)
Changes v2 -> v3:
- fix leftover paths in comments (Ricardo)
- update paths in DEVELOPPERS (Ricardo)
---
DEVELOPERS | 3 ++-
support/scripts/pkg-stats | 2 +-
{support/scripts => tools}/check-package | 2 +-
{support/scripts => tools}/checkpackagelib/__init__.py | 0
{support/scripts => tools}/checkpackagelib/base.py | 2 +-
{support/scripts => tools}/checkpackagelib/lib.py | 2 +-
{support/scripts => tools}/checkpackagelib/lib_config.py | 2 +-
{support/scripts => tools}/checkpackagelib/lib_hash.py | 2 +-
{support/scripts => tools}/checkpackagelib/lib_mk.py | 2 +-
{support/scripts => tools}/checkpackagelib/lib_patch.py | 2 +-
{support/scripts => tools}/checkpackagelib/readme.txt | 10 +++++-----
tools/readme.txt | 4 ++++
12 files changed, 19 insertions(+), 14 deletions(-)
rename {support/scripts => tools}/check-package (98%)
rename {support/scripts => tools}/checkpackagelib/__init__.py (100%)
rename {support/scripts => tools}/checkpackagelib/base.py (78%)
rename {support/scripts => tools}/checkpackagelib/lib.py (95%)
rename {support/scripts => tools}/checkpackagelib/lib_config.py (98%)
rename {support/scripts => tools}/checkpackagelib/lib_hash.py (96%)
rename {support/scripts => tools}/checkpackagelib/lib_mk.py (99%)
rename {support/scripts => tools}/checkpackagelib/lib_patch.py (96%)
rename {support/scripts => tools}/checkpackagelib/readme.txt (91%)DEVELOPERS +2 -1
@@ -1389,7 +1389,8 @@ N: Rhys Williams <[email protected]> F: package/lirc-tools/ N: Ricardo Martincoski <[email protected]> -F: support/scripts/check*package* +F: tools/check-package +F: tools/checkpackagelib/ N: Richard Braun <[email protected]> F: package/curlftpfs/
support/scripts/pkg-stats +1 -1
@@ -337,7 +337,7 @@ for i in $(find boot/ linux/ package/ toolchain/ -name '*.mk' | sort) ; do fi file_list=$(find ${package_dir} -name '*.mk' -o -name '*.in*' -o -name '*.hash') - nwarnings=$(./support/scripts/check-package ${file_list} 2>&1 | sed '/\([0-9]*\) warnings generated/!d; s//\1/') + nwarnings=$(./tools/check-package ${file_list} 2>&1 | sed '/\([0-9]*\) warnings generated/!d; s//\1/') if [ ${nwarnings} -eq 0 ] ; then echo "<td class=\"centered correct\">${nwarnings}</td>" else
tools/check-package renamed from support/scripts/check-package +1 -1
@@ -1,5 +1,5 @@ #!/usr/bin/env python -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. from __future__ import print_function import argparse
tools/checkpackagelib/__init__.py renamed from support/scripts/checkpackagelib/__init__.py +0 -0
tools/checkpackagelib/base.py renamed from support/scripts/checkpackagelib/base.py +1 -1
@@ -1,4 +1,4 @@ -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. class _CheckFunction(object):
tools/checkpackagelib/lib.py renamed from support/scripts/checkpackagelib/lib.py +1 -1
@@ -1,4 +1,4 @@ -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. from base import _CheckFunction
tools/checkpackagelib/lib_config.py renamed from support/scripts/checkpackagelib/lib_config.py +1 -1
@@ -1,4 +1,4 @@ -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. # Kconfig generates errors if someone introduces a typo like "boool" instead of # "bool", so below check functions don't need to check for things already # checked by running "make menuconfig".
tools/checkpackagelib/lib_hash.py renamed from support/scripts/checkpackagelib/lib_hash.py +1 -1
@@ -1,4 +1,4 @@ -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. # The validity of the hashes itself is checked when building, so below check # functions don't need to check for things already checked by running # "make package-dirclean package-source".
tools/checkpackagelib/lib_mk.py renamed from support/scripts/checkpackagelib/lib_mk.py +1 -1
@@ -1,4 +1,4 @@ -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. # There are already dependency checks during the build, so below check # functions don't need to check for things already checked by exploring the # menu options using "make menuconfig" and by running "make" with appropriate
tools/checkpackagelib/lib_patch.py renamed from support/scripts/checkpackagelib/lib_patch.py +1 -1
@@ -1,4 +1,4 @@ -# See support/scripts/checkpackagelib/readme.txt before editing this file. +# See tools/checkpackagelib/readme.txt before editing this file. # The format of the patch files is tested during the build, so below check # functions don't need to check for things already checked by running # "make package-dirclean package-patch".
tools/checkpackagelib/readme.txt renamed from support/scripts/checkpackagelib/readme.txt +5 -5
@@ -57,19 +57,19 @@ Some hints when changing this code: Usage examples: - to get a list of check functions that would be called without actually calling them you can use the --dry-run option: -$ support/scripts/check-package --dry-run package/yourfavorite/* +$ tools/check-package --dry-run package/yourfavorite/* - when you just added a new check function, e.g. Something, check how it behaves for all current packages: -$ support/scripts/check-package --include-only Something $(find package -type f) +$ tools/check-package --include-only Something $(find package -type f) - the effective processing time (when the .pyc were already generated and all files to be processed are cached in the RAM) should stay in the order of few seconds: -$ support/scripts/check-package $(find package -type f) >/dev/null ; \ - time support/scripts/check-package $(find package -type f) >/dev/null +$ tools/check-package $(find package -type f) >/dev/null ; \ + time tools/check-package $(find package -type f) >/dev/null - vim users can navigate the warnings (most editors probably have similar function) since warnings are generated in the form 'path/file:line: warning': $ find package/ -name 'Config.*' > filelist && vim -c \ - 'set makeprg=support/scripts/check-package\ $(cat\ filelist)' -c make -c copen + 'set makeprg=tools/check-package\ $(cat\ filelist)' -c make -c copen
tools/readme.txt +4 -0
@@ -2,6 +2,10 @@ This directory contains various useful scripts and tools for working with Buildroot. You need not add this directory in your PATH to use any of those tools, but you may do so if you want. +check-package + a script that checks the coding style of a package's Config.in and + .mk files, and also tests them for various types of typoes. + get-developpers a script to return the list of people interested in a specific part of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as
Signature · 1 line
2.11.0
PATCH v4 4/7 tools: move size-stat-compare out of support/scripts/
In reply to Yann E. MORINMove it to the top-level tools/ directory, so that it is easier to find for users.
Add a legacy symlink for those users who already used them, so as not to break their habits.
---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)
---
tools/readme.txt | 6 ++++++
{support/scripts => tools}/size-stats-compare | 0
2 files changed, 6 insertions(+)
rename {support/scripts => tools}/size-stats-compare (100%)tools/readme.txt +6 -0
@@ -11,6 +11,12 @@ get-developpers of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as input, a package name or and architecture name. +size-stat-compare + a script to compare the rootfs size between two differnt Buildroot + configurations. This can be used to identify the size impact of + a specific option, or of a set of specific options, or an update + to a newer Buildroot version... + test-pkg a script that tests a specific package against a set of various toolchains, with the goal to detect toolchain-related dependencies
tools/size-stats-compare renamed from support/scripts/size-stats-compare +0 -0
Signature · 1 line
2.11.0
PATCH v4 4/7 tools: move size-stat-compare out of support/scripts/
Hi Yann,
2017-07-01 16:31 GMT+02:00 Yann E. MORIN <[email protected]>:
Quoted 25 lines
Move it to the top-level
tools/directory, so that it is easier to find for users.Add a legacy symlink for those users who already used them, so as not to break their habits.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas De Schampheleire <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Arnout Vandecappelle <[email protected]>---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)--- tools/readme.txt | 6 ++++++ {support/scripts => tools}/size-stats-compare | 0 2 files changed, 6 insertions(+) rename {support/scripts => tools}/size-stats-compare (100%)tools/readme.txt +0
-0
tools/readme.txt get-developpers · line 15
Quoted 5 lines
tools/readme.txt +2
-0@@ -11,6 +11,12 @@ get-developpers of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as input, a package name or and architecture name. +size-stat-compare + a script to compare the rootfs size between two differnt Buildroot
You must have missed my comment about 'differnt' -> 'different'
tools/readme.txt get-developpers · line 18
Quoted 3 lines
tools/readme.txt +3
-0+ configurations. This can be used to identify the size impact of + a specific option, or of a set of specific options, or an update + to a newer Buildroot version...
While you're at it, the last clause would either also need 'of': 'or of an update...',
or otherwise it would need to be removed on the second clause, but now it is inconsistent.
Thanks,
Thomas
PATCH v4 4/7 tools: move size-stat-compare out of support/scripts/
Hello,
Quoted 13 lines · Thomas De Schampheleire
tools/readme.txt get-developpers · line 15
Quoted 10 lines
tools/readme.txt +2
-0@@ -11,6 +11,12 @@ get-developpers of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as input, a package name or and architecture name. +size-stat-compare + a script to compare the rootfs size between two differnt BuildrootYou must have missed my comment about 'differnt' -> 'different'
Quoted 8 lines
tools/readme.txt get-developpers · line 18
Quoted 3 lines
tools/readme.txt +3
-0+ configurations. This can be used to identify the size impact of + a specific option, or of a set of specific options, or an update + to a newer Buildroot version...While you're at it, the last clause would either also need 'of': 'or of an update...',
or otherwise it would need to be removed on the second clause, but now it is inconsistent.
Sorry, I have already pushed. Can you send a patch? :-)
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH v4 4/7 tools: move size-stat-compare out of support/scripts/
In reply to Thomas De SchampheleireThomas, All,
On 2017-07-01 18:02 +0200, Thomas De Schampheleire spake thusly:
Quoted 29 lines
2017-07-01 16:31 GMT+02:00 Yann E. MORIN <[email protected]>:
Quoted 28 lines
Move it to the top-level
tools/directory, so that it is easier to find for users.Add a legacy symlink for those users who already used them, so as not to break their habits.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas De Schampheleire <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Arnout Vandecappelle <[email protected]>---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)--- tools/readme.txt | 6 ++++++ {support/scripts => tools}/size-stats-compare | 0 2 files changed, 6 insertions(+) rename {support/scripts => tools}/size-stats-compare (100%)tools/readme.txt +0
-0@@ -11,6 +11,12 @@ get-developpers of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as input, a package name or and architecture name.
Quoted 4 lines
tools/readme.txt get-developpers · line 15
Quoted 2 lines
tools/readme.txt +2
-0+size-stat-compare + a script to compare the rootfs size between two differnt BuildrootYou must have missed my comment about 'differnt' -> 'different'
Damn, I forgot it. And Thomas already applied it...
Sorry..
Quoted 8 lines
tools/readme.txt get-developpers · line 18
Quoted 3 lines
tools/readme.txt +3
-0+ configurations. This can be used to identify the size impact of + a specific option, or of a set of specific options, or an update + to a newer Buildroot version...While you're at it, the last clause would either also need 'of': 'or of an update...',
or otherwise it would need to be removed on the second clause, but now it is inconsistent.
I'm not sure I follow you...
Regards,
Yann E. MORIN.
Quoted 2 lines
Thanks,
Thomas
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v4 5/7 tools: move scancpan out of support/scripts/
In reply to Yann E. MORINMove it to the top-level tools/ directory, so that it is easier to find for users.
Add a legacy symlink for those users who already used them, so as not to break their habits.
---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)
---
tools/readme.txt | 4 ++++
{support/scripts => tools}/scancpan | 0
2 files changed, 4 insertions(+)
rename {support/scripts => tools}/scancpan (100%)tools/readme.txt +4 -0
@@ -11,6 +11,10 @@ get-developpers of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as input, a package name or and architecture name. +scancpan + a script to create a Buildroot package by scanning a CPAN module + description. + size-stat-compare a script to compare the rootfs size between two differnt Buildroot configurations. This can be used to identify the size impact of
tools/scancpan renamed from support/scripts/scancpan +0 -0
Signature · 1 line
2.11.0
PATCH v4 6/7 tools: move scanpypi out of support/scripts/
In reply to Yann E. MORINMove it to the top-level tools/ directory, so that it is easier to find for users.
Add a legacy symlink for those users who already used them, so as not to break their habits.
---
Changes v3 -> v4:
- drop legacy symlink (Arnout, Thomas)
---
tools/readme.txt | 4 ++++
{support/scripts => tools}/scanpypi | 0
2 files changed, 4 insertions(+)
rename {support/scripts => tools}/scanpypi (100%)tools/readme.txt +4 -0
@@ -15,6 +15,10 @@ scancpan a script to create a Buildroot package by scanning a CPAN module description. +scanpypi + a script to create a Buildroot package by scanning a PyPI package + description. + size-stat-compare a script to compare the rootfs size between two differnt Buildroot configurations. This can be used to identify the size impact of
tools/scanpypi renamed from support/scripts/scanpypi +0 -0
Signature · 1 line
2.11.0
PATCH v4 7/7 tools: new tool to filter the output of make
In reply to Yann E. MORINAdd brmake, a small script that redirects the build output log to a file, keeping just Buildroot's own messages, with the date+time added at the start of the line.
We need to unbuffer the output of make so that, when the script is interrupted (SIGINT, ^C), there is no lingering output not yet digested by the logger loop.
---
Changes v3 -> v4:
- drop options parsing, expand readme (Arnout, Samuel, Thomas)
- nove to the end of the series (Thomas, Arnout)
Changes v2 -> v3:
- detect unconfigured build tree (Ricardo)
- rename 00-README -> readme.txt (Thomas, Arnout)
Changes v1 -> v2:
- rename contrib -> tools (Arnout)
- detect missing unbuffer (Arnout)
Notes:
- Arnout suggested using 'stdbuf' instead of 'unbuffer', but that has some shortcomings in weird corner-cases because it uses LD_PRELOAD to call a constructor that forces settings on stdout/stderr/stdin (it cost me three days to investigate a build failure because of that). So, I stuck with 'unbuffer'...
- I also tried to use bash' coproc, but it seems there was a regression in later bash versions that causes an incorrect redirect. So, I stuck with 'unbuffer'...
--- docs/manual/writing-rules.txt | 5 +++-- tools/brmake | 37 +++++++++++++++++++++++++++++++++++++ tools/readme.txt | 9 +++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100755 tools/brmake
docs/manual/writing-rules.txt +3 -2
@@ -146,5 +146,6 @@ syntax, refer to http://www.methods.co.nz/asciidoc/userguide.html[]. === Support scripts -Some scripts in the +support/+ directory are written in Python and should follow -the https://www.python.org/dev/peps/pep-0008/[PEP8 Style Guide for Python Code]. +Some scripts in the +support/+ and +tools/+ directories are written in +Python and should follow the +https://www.python.org/dev/peps/pep-0008/[PEP8 Style Guide for Python Code].
tools/brmake new file +37 -0
@@ -0,0 +1,37 @@ +#!/bin/bash +# (C) 2016, "Yann E. MORIN" <[email protected]> +# License: WTFPL, https://spdx.org/licenses/WTFPL.html + +main() { + local found ret start d h m mf + + if ! which unbuffer >/dev/null 2>&1; then + printf "you need to install 'unbuffer' (from package expect or expect-dev)\n" >&2 + exit 1 + fi + + start=${SECONDS} + + ( exec 2>&1; unbuffer make "${@}"; ) \ + > >( while read line; do + printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}" + done \ + |tee -a br.log \ + |grep --colour=never -E '>>>' + ) + ret=${?} + + d=$((SECONDS-start)) + printf "Done in " + h=$((d/3600)) + d=$((d%3600)) + [ ${h} -eq 0 ] || { printf "%dh " ${h}; mf="02"; } + m=$((d/60)) + d=$((d%60)) + [ ${m} -eq 0 ] || { printf "%${mf}dmin " ${m}; sf="02"; } + printf "%${sf}ds\n" ${d} + + return ${ret} +} + +main "${@}"
tools/readme.txt +9 -0
@@ -2,6 +2,15 @@ This directory contains various useful scripts and tools for working with Buildroot. You need not add this directory in your PATH to use any of those tools, but you may do so if you want. +brmake + a script that can be run instead of make, that prepends the date in + front of each line, redirects all of the build output to a file + ("'br.log' in the current directory), and just outputs the Buildroot + messages (those lines starting with >>>) on stdout. + Do not run this script for interactive configuration (e.g. menuconfig) + or on an unconfigured directory. The output is redirected so you will see + nothing. + check-package a script that checks the coding style of a package's Config.in and .mk files, and also tests them for various types of typoes.
Signature · 1 line
2.11.0
v4 cover tools: add a directory to contain usefull user-facing tools
In reply to Yann E. MORINHello,
Quoted 8 lines · Yann E. MORIN
Yann E. MORIN (7):
tools: move test-pkg out of support/scripts
tools: move get-developers out of support/scripts/
tools: move check-package out of support/scripts/
tools: move size-stat-compare out of support/scripts/
tools: move scancpan out of support/scripts/
tools: move scanpypi out of support/scripts/
tools: new tool to filter the output of make
All applied. As discussed, I have changed the name of the directory from "tools/" to "utils/" in order to avoid the tab-completion conflict with the top-level "toolchain/" folder.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com