Use [[ for =~ matches

Avoid incorrect use of [ with =~ matching

I guess this doesn't trip "-e" because it's in an if-conditional.  I'm
looking at making bashate detect this; maybe we can run bashate over
things we know are scripts

Change-Id: Ia3fe2b978fae5bdaadbb1789058180d3ad950d00
This commit is contained in:
Ian Wienand 2017-08-28 17:01:03 +10:00
parent 058debc7dd
commit c448864901
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ fi
select_boot_kernel_initrd $TARGET_ROOT select_boot_kernel_initrd $TARGET_ROOT
# Serial console on Power is hvc0 # Serial console on Power is hvc0
if [ "powerpc ppc64 ppc64le" =~ "$ARCH" ] ; then if [[ "powerpc ppc64 ppc64le" =~ "$ARCH" ]] ; then
SERIAL_CONSOLE="hvc0" SERIAL_CONSOLE="hvc0"
else else
SERIAL_CONSOLE="ttyS0,115200" SERIAL_CONSOLE="ttyS0,115200"

View File

@ -147,7 +147,7 @@ function install_grub2 {
echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub
# Serial console on Power is hvc0 # Serial console on Power is hvc0
if [ "powerpc ppc64 ppc64le" =~ "$ARCH" ] ; then if [[ "powerpc ppc64 ppc64le" =~ "$ARCH" ]]; then
SERIAL_CONSOLE="hvc0" SERIAL_CONSOLE="hvc0"
else else
SERIAL_CONSOLE="ttyS0,115200" SERIAL_CONSOLE="ttyS0,115200"