a194055ef67a8e29d0edce5e0e1dc0edc081fdf9
[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 14:16:38 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       # update-alternates does not work without /usr/share/man because
21       # it configures (in our case non-existent) manpages as well :-/
22       # $ROOTCMD update-alternatives --set editor /usr/bin/vim.tiny
23       # $ROOTCMD update-alternatives --set vi     /usr/bin/vim.tiny
24       $ROOTCMD ln -sf /usr/bin/editor /etc/alternatives/editor
25       $ROOTCMD ln -sf /etc/alternatives/editor /usr/bin/vim.tiny
26       $ROOTCMD ln -sf /usr/bin/vi /etc/alternatives/vi
27       $ROOTCMD ln -sf /etc/alternatives/vi /usr/bin/vim.tiny
28    fi
29 fi
30
31 if [ -r $target/usr/bin/vim.basic ] ; then
32    $ROOTCMD update-alternatives --set editor /usr/bin/vim.basic
33    $ROOTCMD update-alternatives --set vi     /usr/bin/vim.basic
34 fi
35
36 if [ -r $target/usr/bin/uxterm ] ; then
37    $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/uxterm
38 elif [ -r $target/usr/bin/xterm ] ; then
39    $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/xterm
40 fi
41
42 if [ -r $target/etc/X11/cursors/whiteglass.theme ] ; then
43    $ROOTCMD update-alternatives --set x-cursor-theme /etc/X11/cursors/whiteglass.theme
44 fi
45
46 if [ -r $target/usr/bin/iceweasel ] ; then
47    $ROOTCMD update-alternatives --set x-www-browser /usr/bin/iceweasel
48 fi
49
50 if [ -r $target/usr/bin/w3m ] ; then
51    $ROOTCMD update-alternatives --set www-browser /usr/bin/w3m
52 fi
53
54 ## END OF FILE #################################################################
55 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3