[Fuego] [PATCH] bzip2: add support for busybox version of bzip2

Bird, Timothy Tim.Bird at am.sony.com
Fri Oct 14 19:06:28 UTC 2016



> -----Original Message-----
> From: Daniel Sangorrin [mailto:daniel.sangorrin at toshiba.co.jp]
> Sent: Friday, October 14, 2016 10:01 AM
> To: fuego at lists.linuxfoundation.org
> Cc: Bird, Timothy <Tim.Bird at am.sony.com>;
> dmitry.cherkasov at cogentembedded.com
> Subject: [PATCH] bzip2: add support for busybox version of bzip2
> 
> busybox bzip2 does not support the -s option.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  engine/tests/Functional.bzip2/bzip2.sh | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/engine/tests/Functional.bzip2/bzip2.sh
> b/engine/tests/Functional.bzip2/bzip2.sh
> index 8e725c8..61c1265 100644
> --- a/engine/tests/Functional.bzip2/bzip2.sh
> +++ b/engine/tests/Functional.bzip2/bzip2.sh
> @@ -2,12 +2,21 @@ tarball=bzip2-1.0.5.tar.gz
> 
>  function test_build {
>      echo "#!/bin/bash
> +    function is_busybox {
> +        realname=\$(readlink -f \$1)
> +        if echo "\$realname" | grep -q "busybox"; then return 0; fi
> +        return 1
> +    }
>      if bzip2 -1  < sample1.ref > sample1.rb2; then echo 'TEST-1 OK'; else echo
> 'TEST-1 FAILED'; fi;
>      if bzip2 -2  < sample2.ref > sample2.rb2; then echo 'TEST-2 OK'; else echo
> 'TEST-2 FAILED'; fi;
>      if bzip2 -3  < sample3.ref > sample3.rb2; then echo 'TEST-3 OK'; else echo
> 'TEST-3 FAILED'; fi;
>      if bzip2 -d  < sample1.bz2 > sample1.tst; then echo 'TEST-4 OK'; else echo
> 'TEST-4 FAILED'; fi;
>      if bzip2 -d  < sample2.bz2 > sample2.tst; then echo 'TEST-5 OK'; else echo
> 'TEST-5 FAILED'; fi;
> -    if bzip2 -ds < sample3.bz2 > sample3.tst; then echo 'TEST-6 OK'; else echo
> 'TEST-6 FAILED'; fi;
> +    if ( is_busybox \$(which bzip2) ); then
> +        if bzip2 -d < sample3.bz2 > sample3.tst; then echo 'TEST-6 OK'; else echo
> 'TEST-6 FAILED'; fi;
> +    else
> +        if bzip2 -ds < sample3.bz2 > sample3.tst; then echo 'TEST-6 OK'; else
> echo 'TEST-6 FAILED'; fi;
> +    fi
>      if cmp sample1.bz2 sample1.rb2; then echo 'TEST-7 OK'; else echo 'TEST-7
> FAILED'; fi;
>      if cmp sample2.bz2 sample2.rb2; then echo 'TEST-8 OK'; else echo 'TEST-8
> FAILED'; fi;
>      if cmp sample3.bz2 sample3.rb2; then echo 'TEST-9 OK'; else echo 'TEST-9
> FAILED'; fi;
> --
> 2.7.4
> 
> 

This looks like a nice fix.  I'll test it out over the weekend.  Sorry about the delay
I'm still recovering from ELCE and my Linux Foundation meetings.  Thanks for the patches.
 -- Tim



More information about the Fuego mailing list