[OpenWrt-Devel] [PATCHv2 1/4] scripts/gen_image_generic.sh: Replace -o with ||

Hartmut Knaack knaack.h at gmx.de
Tue Dec 31 16:22:21 EST 2019


Rosen Penev schrieb am 30.12.2019 um 06:07:
> -o is not well defined.
>
> Found with shellcheck.
>
> Signed-off-by: Rosen Penev <rosenp at gmail.com>
> ---
>  scripts/gen_image_generic.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
> index 2d2fb120ce..1e35b1b349 100755
> --- a/scripts/gen_image_generic.sh
> +++ b/scripts/gen_image_generic.sh
> @@ -1,10 +1,10 @@
>  #!/usr/bin/env bash
>  # Copyright (C) 2006-2012 OpenWrt.org
>  set -e -x
> -[ $# == 5 -o $# == 6 ] || {
> +if [ $# -ge 5 ] || [ $# -le 6 ]; then
>      echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image> [<align>]"
>      exit 1
> -}
> +fi
>
>  OUTPUT="$1"
>  KERNELSIZE="$2"
>
Hi,
this does not look right. You changed it from reporting a failure in case there
was any other amount of options than 5 or 6 given, to reporting a failure if at
least 5 or at most 6 options are provided (in other words: every amount).

Regards,

Hartmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x03684A18FAC89148.asc
Type: application/pgp-keys
Size: 3086 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20191231/75616961/attachment.bin>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list