--- update-grub.orig 2008-01-27 12:49:41.000000000 +0100 +++ update-grub.new 2008-01-27 12:56:10.000000000 +0100 @@ -1,5 +1,4 @@ -#! /bin/sh -e - +#!/bin/sh -e # Generate grub.cfg by inspecting /boot contents. # Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. # @@ -22,6 +21,9 @@ address@hidden@ address@hidden@ address@hidden@ address@hidden@ address@hidden@ address@hidden@ address@hidden@ grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg=${grub_prefix}/grub.cfg @@ -34,6 +36,47 @@ # for convert_system_path_to_grub_path(), font_path() . ${libdir}/grub/update-grub_lib +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "update-grub (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + -y) + echo "$0: warning: Ignoring -y option (no longer needed)." >&2 + -*) + echo "$0: warning: Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + *) + echo "$0: warning: Unexpected argument \`$option'" 1>&2 + usage + exit 1 + esac +done + if [ "x$UID" = "x" ] ; then UID=`id -u` fi @@ -43,10 +86,6 @@ exit 1 fi -if [ "$1" = "-y" ] ; then - echo "$0: warning: Ignoring -y option (no longer needed)." >&2 -fi - set $grub_mkdevicemap dummy if test -f "$1"; then :