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

« back to all changes in this revision

Viewing changes to util/grub-kbdcomp.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:
5
5
prefix="@prefix@"
6
6
exec_prefix="@exec_prefix@"
7
7
bindir="@bindir@"
8
 
 
9
 
grub_mklayout=${bindir}/`echo grub-mklayout | sed ${transform}`
10
 
 
11
 
ckbcomp "$@" | $grub_mklayout -o "$1".gkb
 
8
datarootdir="@datarootdir@"
 
9
datadir="@datadir@"
 
10
if [ "x$pkgdatadir" = x ]; then
 
11
    pkgdatadir="${datadir}/@PACKAGE@"
 
12
fi
 
13
 
 
14
grub_mklayout="${bindir}/`echo grub-mklayout | sed ${transform}`"
 
15
 
 
16
ckbcomp_options=""
 
17
 
 
18
export TEXTDOMAIN=@PACKAGE@
 
19
export TEXTDOMAINDIR="@localedir@"
 
20
 
 
21
. "${pkgdatadir}/grub-mkconfig_lib"
 
22
 
 
23
self=`basename $0`
 
24
 
 
25
usage () {
 
26
    gettext_printf "Usage: %s -o OUTPUT CKBMAP_ARGUMENTS...\n" "$self"
 
27
    gettext "Make GRUB keyboard layout file."; echo
 
28
    echo
 
29
    print_option_help "-h, --help" "$(gettext "print this message and exit")"
 
30
    print_option_help "-v, --version" "$(gettext "print the version information and exit")"
 
31
    print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")"
 
32
    echo
 
33
    gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self"
 
34
    echo
 
35
    gettext "Report bugs to <bug-grub@gnu.org>."; echo
 
36
}
 
37
 
 
38
argument () {
 
39
  opt=$1
 
40
  shift
 
41
 
 
42
  if test $# -eq 0; then
 
43
      gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
 
44
      exit 1
 
45
  fi
 
46
  echo $1
 
47
}
 
48
 
 
49
output=
 
50
 
 
51
while test $# -gt 0
 
52
do
 
53
    option=$1
 
54
    shift
 
55
    case "$option" in
 
56
    -h | --help)
 
57
        usage
 
58
        exit 0 ;;
 
59
    -v | --version)
 
60
        echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
 
61
        exit 0 ;;
 
62
    -o | --output)
 
63
        output=`argument $option "$@"`; shift ;;
 
64
    --output=*)
 
65
        output=`echo "$option" | sed 's/--output=//'` ;;
 
66
    *)
 
67
        ckbcomp_options="$ckbcomp_options $option";;
 
68
    esac
 
69
done
 
70
 
 
71
if [ "x${output}" = x ] ; then
 
72
  gettext "output file must be specified" >&2
 
73
  echo >&2
 
74
  usage
 
75
  exit 1
 
76
fi
 
77
 
 
78
ckbcomp $ckbcomp_options | "$grub_mklayout" -o "${output}"
12
79