011fe8
From 4ec08b960f6de1190dea9fe7e6ab3b4b249840e5 Mon Sep 17 00:00:00 2001
78a3d7
From: Colin Watson <cjwatson@ubuntu.com>
78a3d7
Date: Fri, 17 Jan 2014 15:24:50 +0000
58fe9a
Subject: [PATCH 018/152] Prefer more portable test(1) constructs
78a3d7
78a3d7
* util/grub.d/00_header.in (make_timeout): Use && rather than test
78a3d7
-a.
78a3d7
* util/grub.d/10_windows.in: Likewise.
78a3d7
* util/grub.d/10_netbsd.in (netbsd_load_fs_module): Use || rather
78a3d7
than test -o.
78a3d7
* util/grub.d/30_os-prober.in: Use && rather than test -a, and ||
78a3d7
rather than test -o.
78a3d7
---
78a3d7
 ChangeLog                   | 12 +++++++++++-
78a3d7
 util/grub.d/00_header.in    |  2 +-
78a3d7
 util/grub.d/10_netbsd.in    |  2 +-
78a3d7
 util/grub.d/10_windows.in   |  4 ++--
78a3d7
 util/grub.d/30_os-prober.in |  4 ++--
78a3d7
 5 files changed, 17 insertions(+), 7 deletions(-)
78a3d7
78a3d7
diff --git a/ChangeLog b/ChangeLog
011fe8
index 6613b4e..c8e95a6 100644
78a3d7
--- a/ChangeLog
78a3d7
+++ b/ChangeLog
78a3d7
@@ -1,4 +1,14 @@
78a3d7
-2014-01-17  Colin Watson  <cjwatson@debian.org>
78a3d7
+2014-01-17  Colin Watson  <cjwatson@ubuntu.com>
78a3d7
+
78a3d7
+	* util/grub.d/00_header.in (make_timeout): Use && rather than test
78a3d7
+	-a.
78a3d7
+	* util/grub.d/10_windows.in: Likewise.
78a3d7
+	* util/grub.d/10_netbsd.in (netbsd_load_fs_module): Use || rather
78a3d7
+	than test -o.
78a3d7
+	* util/grub.d/30_os-prober.in: Use && rather than test -a, and ||
78a3d7
+	rather than test -o.
78a3d7
+
78a3d7
+2014-01-17  Colin Watson  <cjwatson@ubuntu.com>
78a3d7
 
78a3d7
 	* grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove
78a3d7
 	redundant preprocessor conditional.
78a3d7
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
78a3d7
index 0c82f23..ce2ec81 100644
78a3d7
--- a/util/grub.d/00_header.in
78a3d7
+++ b/util/grub.d/00_header.in
78a3d7
@@ -285,7 +285,7 @@ make_timeout ()
78a3d7
     if [ "x${3}" != "x" ] ; then
78a3d7
 	timeout="${2}"
78a3d7
 	style="${3}"
78a3d7
-    elif [ "x${1}" != "x" -a "x${1}" != "x0" ] ; then
78a3d7
+    elif [ "x${1}" != "x" ] && [ "x${1}" != "x0" ] ; then
78a3d7
 	# Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme.
78a3d7
 	timeout="${1}"
78a3d7
 	if [ "x${2}" != "x0" ] ; then
78a3d7
diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in
78a3d7
index 29a0e41..9988a42 100644
78a3d7
--- a/util/grub.d/10_netbsd.in
78a3d7
+++ b/util/grub.d/10_netbsd.in
78a3d7
@@ -69,7 +69,7 @@ netbsd_load_fs_module ()
78a3d7
   kversion=$(zcat -f "${kernel}" | strings | sed -n -e '/^@(#)NetBSD/ { s/^@(#)NetBSD \([0-9\.]*\) .*$/\1/g ; p ; q ; }')
78a3d7
   kmodule="/stand/${karch}/${kversion}/modules/${kmod}/${kmod}.kmod"
78a3d7
 
78a3d7
-  if test -z "$karch" -o -z "$kversion" -o ! -f "${kmodule}"; then
78a3d7
+  if test -z "$karch" || test -z "$kversion" || test ! -f "${kmodule}"; then
78a3d7
     return
78a3d7
   fi
78a3d7
 
78a3d7
diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in
78a3d7
index 9025914..48bd955 100644
78a3d7
--- a/util/grub.d/10_windows.in
78a3d7
+++ b/util/grub.d/10_windows.in
78a3d7
@@ -66,11 +66,11 @@ for drv in $drives ; do
78a3d7
   osid=
78a3d7
 
78a3d7
   # Check for Vista bootmgr.
78a3d7
-  if [ -f "$dir"/bootmgr -a -f "$dir"/boot/bcd ] ; then
78a3d7
+  if [ -f "$dir"/bootmgr ] && [ -f "$dir"/boot/bcd ] ; then
78a3d7
     OS="$(gettext "Windows Vista/7 (loader)")"
78a3d7
     osid=bootmgr
78a3d7
   # Check for NTLDR.
78a3d7
-  elif [ -f "$dir"/ntldr -a -f "$dir"/ntdetect.com -a -f "$dir"/boot.ini ] ; then
78a3d7
+  elif [ -f "$dir"/ntldr ] && [ -f "$dir"/ntdetect.com ] && [ -f "$dir"/boot.ini ] ; then
78a3d7
     OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="$(gettext "Windows NT/2000/XP (loader)")"
78a3d7
     osid=ntldr
78a3d7
     needmap=t
78a3d7
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
78a3d7
index 0470e66..7cf8487 100644
78a3d7
--- a/util/grub.d/30_os-prober.in
78a3d7
+++ b/util/grub.d/30_os-prober.in
78a3d7
@@ -30,7 +30,7 @@ if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
78a3d7
   exit 0
78a3d7
 fi
78a3d7
 
78a3d7
-if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
78a3d7
+if [ -z "`which os-prober 2> /dev/null`" ] || [ -z "`which linux-boot-prober 2> /dev/null`" ] ; then
78a3d7
   # missing os-prober and/or linux-boot-prober
78a3d7
   exit 0
78a3d7
 fi
78a3d7
@@ -119,7 +119,7 @@ for OS in ${OSPROBED} ; do
78a3d7
       EXPUUID="${EXPUUID}@${DEVICE#*@}"
78a3d7
   fi
78a3d7
 
78a3d7
-  if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" -a "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
78a3d7
+  if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
78a3d7
     echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
78a3d7
     continue
78a3d7
   fi
78a3d7
-- 
37b39b
1.9.3
78a3d7