diff mbox series

[1/1] utils/test-pkg: proper output on host without jq installed

Message ID 20221012164831.10476-1-sebastien.szymanski@armadeus.com
State Accepted
Headers show
Series [1/1] utils/test-pkg: proper output on host without jq installed | expand

Commit Message

Sébastien Szymanski Oct. 12, 2022, 4:48 p.m. UTC
On host without jq installed, test-pkg's output is as following:

$ ./utils/test-pkg -p mmc-utils
                    bootlin-armv5-uclibc [1/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
JQ IS
OK
                     bootlin-armv7-glibc [2/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
JQ IS
OK
                   bootlin-armv7m-uclibc [3/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
...

Since test-pkg handles this case we can hide this error message and have
proper output:

$ ./utils/test-pkg -p mmc-utils
                    bootlin-armv5-uclibc [1/6]: OK
                     bootlin-armv7-glibc [2/6]: OK
                   bootlin-armv7m-uclibc [3/6]: OK

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
 utils/test-pkg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Romain Naour Feb. 7, 2023, 4:39 p.m. UTC | #1
Hello Sebastien,

Adding Yann in Cc.

Le 12/10/2022 à 18:48, Sébastien Szymanski a écrit :
> On host without jq installed, test-pkg's output is as following:

Is jq is listed as optional dependencies of Buildroot?

> 
> $ ./utils/test-pkg -p mmc-utils
>                     bootlin-armv5-uclibc [1/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
> JQ IS
> OK
>                      bootlin-armv7-glibc [2/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
> JQ IS
> OK
>                    bootlin-armv7m-uclibc [3/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
> ...
> 
> Since test-pkg handles this case we can hide this error message and have
> proper output:
> 
> $ ./utils/test-pkg -p mmc-utils
>                     bootlin-armv5-uclibc [1/6]: OK
>                      bootlin-armv7-glibc [2/6]: OK
>                    bootlin-armv7m-uclibc [3/6]: OK

Indeed, jq was introduced in test-pkg by [1]

[1]
https://git.buildroot.net/buildroot/commit/?id=f29239cf9bc21d9632031077354b6ba5c868cc1f

Reviewed-by: Romain Naour <romain.naour@smile.fr>

Best regards,
Romain

> 
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
>  utils/test-pkg | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/test-pkg b/utils/test-pkg
> index 4ebfd9af66..e7f5464817 100755
> --- a/utils/test-pkg
> +++ b/utils/test-pkg
> @@ -201,7 +201,7 @@ build_one() {
>  
>      # Validate that we generate proper json as show-info
>      { tput smso; printf '>>> Running show-info\n'; tput rmso; } >> "${dir}/logfile" 2> /dev/null;
> -    JQ="$(which jq)"
> +    JQ="$(which jq 2> /dev/null)"
>      if [ -z "${JQ}" ]; then
>          make O="${dir}" host-jq >> "${dir}/logfile" 2>&1
>          JQ="${dir}/host/bin/jq"
Yann E. MORIN Feb. 7, 2023, 4:51 p.m. UTC | #2
Sébastien, All,

On 2022-10-12 18:48 +0200, Sébastien Szymanski spake thusly:
> On host without jq installed, test-pkg's output is as following:
> 
> $ ./utils/test-pkg -p mmc-utils
>                     bootlin-armv5-uclibc [1/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
> JQ IS
> OK
>                      bootlin-armv7-glibc [2/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
> JQ IS
> OK
>                    bootlin-armv7m-uclibc [3/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
> ...
> 
> Since test-pkg handles this case we can hide this error message and have
> proper output:
> 
> $ ./utils/test-pkg -p mmc-utils
>                     bootlin-armv5-uclibc [1/6]: OK
>                      bootlin-armv7-glibc [2/6]: OK
>                    bootlin-armv7m-uclibc [3/6]: OK
> 
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  utils/test-pkg | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/test-pkg b/utils/test-pkg
> index 4ebfd9af66..e7f5464817 100755
> --- a/utils/test-pkg
> +++ b/utils/test-pkg
> @@ -201,7 +201,7 @@ build_one() {
>  
>      # Validate that we generate proper json as show-info
>      { tput smso; printf '>>> Running show-info\n'; tput rmso; } >> "${dir}/logfile" 2> /dev/null;
> -    JQ="$(which jq)"
> +    JQ="$(which jq 2> /dev/null)"
>      if [ -z "${JQ}" ]; then
>          make O="${dir}" host-jq >> "${dir}/logfile" 2>&1
>          JQ="${dir}/host/bin/jq"
> -- 
> 2.37.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Peter Korsgaard Feb. 24, 2023, 7:35 a.m. UTC | #3
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Sébastien, All,
 > On 2022-10-12 18:48 +0200, Sébastien Szymanski spake thusly:
 >> On host without jq installed, test-pkg's output is as following:
 >> 
 >> $ ./utils/test-pkg -p mmc-utils
 >> bootlin-armv5-uclibc [1/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
 >> JQ IS
 >> OK
 >> bootlin-armv7-glibc [2/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
 >> JQ IS
 >> OK
 >> bootlin-armv7m-uclibc [3/6]: which: no jq in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/usr/lib/llvm/13/bin:/usr/lib64/opencascade/bin)
 >> ...
 >> 
 >> Since test-pkg handles this case we can hide this error message and have
 >> proper output:
 >> 
 >> $ ./utils/test-pkg -p mmc-utils
 >> bootlin-armv5-uclibc [1/6]: OK
 >> bootlin-armv7-glibc [2/6]: OK
 >> bootlin-armv7m-uclibc [3/6]: OK
 >> 
 >> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>

 > Applied to master, thanks.

Committed to 2022.11.x and 2022.02.x, thanks.
diff mbox series

Patch

diff --git a/utils/test-pkg b/utils/test-pkg
index 4ebfd9af66..e7f5464817 100755
--- a/utils/test-pkg
+++ b/utils/test-pkg
@@ -201,7 +201,7 @@  build_one() {
 
     # Validate that we generate proper json as show-info
     { tput smso; printf '>>> Running show-info\n'; tput rmso; } >> "${dir}/logfile" 2> /dev/null;
-    JQ="$(which jq)"
+    JQ="$(which jq 2> /dev/null)"
     if [ -z "${JQ}" ]; then
         make O="${dir}" host-jq >> "${dir}/logfile" 2>&1
         JQ="${dir}/host/bin/jq"