Workaround debug: unbound variable
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 90-update-alternatives
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/90-update-alternatives
3 # Purpose:       set up /etc/alternatives/* according to grml preferences
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 # Latest change: Mon Sep 29 13:58:14 CEST 2008 [mika]
8 ################################################################################
9
10 set -u
11 set -e
12
13 ## Editor:
14 # Too many people don't expect to get that, so use it only for grml-small:
15 # avoid "debug: unbound variable"
16 set +u
17 if ifclass GRML_SMALL ; then
18 set -u
19    if [ -r $target/usr/bin/vim.tiny ] ; then
20       $ROOTCMD update-alternatives --set editor /usr/bin/vim.tiny
21       $ROOTCMD update-alternatives --set vi     /usr/bin/vim.tiny
22    fi
23 else
24    # avoid "debug: unbound variable" for ifclass running with 'set -u'
25    true
26 fi
27
28 if [ -r $target/usr/bin/vim.basic ] ; then
29    $ROOTCMD update-alternatives --set editor /usr/bin/vim.basic
30    $ROOTCMD update-alternatives --set vi     /usr/bin/vim.basic
31 fi
32
33 if [ -r $target/usr/bin/uxterm ] ; then
34    $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/uxterm
35 elif [ -r $target/usr/bin/xterm ] ; then
36    $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/xterm
37 fi
38
39 if [ -r $target/etc/X11/cursors/whiteglass.theme ] ; then
40    $ROOTCMD update-alternatives --set x-cursor-theme /etc/X11/cursors/whiteglass.theme
41 fi
42
43 if [ -r $target/usr/bin/iceweasel ] ; then
44    $ROOTCMD update-alternatives --set x-www-browser /usr/bin/iceweasel
45 fi
46
47 if [ -r $target/usr/bin/w3m ] ; then
48    $ROOTCMD update-alternatives --set www-browser /usr/bin/w3m
49 fi
50
51 ## END OF FILE #################################################################
52 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3