~ubuntu-branches/debian/stretch/grub2/stretch

« back to all changes in this revision

Viewing changes to util/grub-set-default.in

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-06-15 12:45:35 UTC
  • mto: (1.14.1 upstream) (17.3.18 experimental)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20100615124535-9vfbis4kzv0h5bgy
Tags: upstream-1.98+20100614
ImportĀ upstreamĀ versionĀ 1.98+20100614

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
prefix=@prefix@
23
23
exec_prefix=@exec_prefix@
24
24
bindir=@bindir@
 
25
PACKAGE_NAME=@PACKAGE_NAME@
 
26
PACKAGE_VERSION=@PACKAGE_VERSION@
 
27
 
 
28
self=`basename $0`
25
29
 
26
30
grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
27
31
rootdir=
30
34
# Print the usage.
31
35
usage () {
32
36
    cat <<EOF
33
 
Usage: $0 [OPTION] entry
 
37
Usage: $self [OPTION] entry
34
38
Set the default boot entry for GRUB.
35
39
 
36
40
  -h, --help              print this message and exit
44
48
EOF
45
49
}
46
50
 
 
51
argument () {
 
52
  opt=$1
 
53
  shift
 
54
 
 
55
  if test $# -eq 0; then
 
56
      echo "$0: option requires an argument -- '$opt'" 1>&2
 
57
      exit 1
 
58
  fi
 
59
  echo $1
 
60
}
 
61
 
47
62
# Check the arguments.
48
 
for option in "$@"; do
 
63
while test $# -gt 0
 
64
do
 
65
    option=$1
 
66
    shift
 
67
 
49
68
    case "$option" in
50
69
    -h | --help)
51
70
        usage
52
71
        exit 0 ;;
53
72
    -v | --version)
54
 
        echo "grub-set-default (GNU GRUB ${PACKAGE_VERSION})"
 
73
        echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
55
74
        exit 0 ;;
 
75
 
 
76
    --root-directory)
 
77
        rootdir=`argument $option "$@"`; shift ;;
56
78
    --root-directory=*)
57
79
        rootdir=`echo "$option" | sed 's/--root-directory=//'` ;;
 
80
 
58
81
    -*)
59
82
        echo "Unrecognized option \`$option'" 1>&2
60
83
        usage