~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
bindir=@bindir@
25
25
PACKAGE_NAME=@PACKAGE_NAME@
26
26
PACKAGE_VERSION=@PACKAGE_VERSION@
 
27
datarootdir="@datarootdir@"
 
28
datadir="@datadir@"
 
29
if [ "x$pkgdatadir" = x ]; then
 
30
    pkgdatadir="${datadir}/@PACKAGE@"
 
31
fi
27
32
 
28
33
self=`basename $0`
29
34
 
32
37
bootdir=
33
38
grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
34
39
 
 
40
export TEXTDOMAIN=@PACKAGE@
 
41
export TEXTDOMAINDIR="@localedir@"
 
42
 
 
43
. "${pkgdatadir}/grub-mkconfig_lib"
 
44
 
35
45
# Usage: usage
36
46
# Print the usage.
37
47
usage () {
38
 
    cat <<EOF
39
 
Usage: $self [OPTION] entry
40
 
Set the default boot entry for GRUB.
41
 
 
42
 
  -h, --help              print this message and exit
43
 
  -v, --version           print the version information and exit
44
 
  --boot-directory=DIR    expect GRUB images under the directory DIR/@grubdirname@
45
 
                          instead of the $grubdir directory
46
 
 
47
 
ENTRY is a number or a menu item title.
48
 
 
49
 
Report bugs to <bug-grub@gnu.org>.
50
 
EOF
 
48
    gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self"
 
49
    gettext "Set the default boot menu entry for GRUB."; echo
 
50
    echo
 
51
    print_option_help "-h, --help" "$(gettext "print this message and exit")"
 
52
    print_option_help "-v, --version" "$(gettext "print the version information and exit")"
 
53
    dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
 
54
    print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg"
 
55
    echo
 
56
    gettext "MENU_ENTRY is a number, a menu item title or a menu item identifier."; echo
 
57
    echo
 
58
    gettext "Report bugs to <bug-grub@gnu.org>."; echo
51
59
}
52
60
 
53
61
argument () {
55
63
  shift
56
64
 
57
65
  if test $# -eq 0; then
58
 
      echo "$0: option requires an argument -- '$opt'" 1>&2
 
66
      gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
59
67
      exit 1
60
68
  fi
61
69
  echo $1
87
95
    bootdir=`echo "$option" | sed 's/--boot-directory=//'` ;;
88
96
 
89
97
    -*)
90
 
        echo "Unrecognized option \`$option'" 1>&2
 
98
        gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
91
99
        usage
92
100
        exit 1
93
101
        ;;
94
102
    *)
95
103
        if test "x$entry" != x; then
96
 
            echo "More than one entry?" 1>&2
 
104
            gettext "More than one menu entry?" 1>&2
 
105
            echo >&2
97
106
            usage
98
107
            exit 1
99
108
        fi
102
111
done
103
112
 
104
113
if test "x$entry" = x; then
105
 
    echo "entry not specified." 1>&2
 
114
    gettext "Menu entry not specified." 1>&2
 
115
    echo >&2
106
116
    usage
107
117
    exit 1
108
118
fi