]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkconfig.in: Fix handling of -o so that it works when
authorColin Watson <cjwatson@ubuntu.com>
Fri, 21 May 2010 13:17:15 +0000 (14:17 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Fri, 21 May 2010 13:17:15 +0000 (14:17 +0100)
not the first option.

ChangeLog
util/grub-mkconfig.in

index cdff463e40095432ce8fbb9684517c397cdc6ba2..02503a90fb3b3acbe08d49a1230acbd9e9218317 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-21  Colin Watson  <cjwatson@ubuntu.com>
+
+       * util/grub-mkconfig.in: Fix handling of -o so that it works when
+       not the first option.
+
 2010-05-20  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/grub-mkrelpath.c (usage): Remove excess apostrophe.
index 85212f8fc0b30efc53a9032e9b3bd272e7d6df7e..d1abfa36a06c08ae0b38d38e3245b4ab174afba2 100644 (file)
@@ -50,7 +50,13 @@ EOF
 }
 
 # Check the arguments.
+next_grub_cfg=false
 for option in "$@"; do
+    if $next_grub_cfg; then
+       grub_cfg=$option
+       next_grub_cfg=false
+       continue
+    fi
     case "$option" in
     -h | --help)
        usage
@@ -59,8 +65,7 @@ for option in "$@"; do
        echo "$0 (GNU GRUB ${package_version})"
        exit 0 ;;
     -o)
-       shift
-       grub_cfg=$1
+       next_grub_cfg=:
        ;;
     --output=*)
        grub_cfg=`echo "$option" | sed 's/--output=//'`
@@ -72,6 +77,11 @@ for option in "$@"; do
        ;;
     esac
 done
+if $next_grub_cfg; then
+    echo "Missing argument to \`-o'" 1>&2
+    usage
+    exit 1
+fi
 
 . ${libdir}/grub/grub-mkconfig_lib