Drop Latest change lines, add initial support for Debian/squeeze
[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 ################################################################################
8
9 set -u
10 set -e
11
12 ## Editor:
13 # Too many people don't expect to get that, so use it only for grml-small
14 # avoid "debug: unbound variable":
15 set +u
16 if ifclass GRML_SMALL ; then
17 set -u
18    if [ -r $target/usr/bin/vim.tiny ] ; then
19       # update-alternates does not work without /usr/share/man because
20       # it configures (in our case non-existent) manpages as well :-/
21       # $ROOTCMD update-alternatives --set editor /usr/bin/vim.tiny
22       # $ROOTCMD update-alternatives --set vi     /usr/bin/vim.tiny
23       $ROOTCMD ln -sf /etc/alternatives/editor /usr/bin/editor
24       $ROOTCMD ln -sf /usr/bin/vim.tiny /etc/alternatives/editor 
25       $ROOTCMD ln -sf /etc/alternatives/vi /usr/bin/vi
26       $ROOTCMD ln -sf /usr/bin/vim.tiny /etc/alternatives/vi 
27    fi
28 fi
29
30 if [ -r $target/usr/bin/vim.basic ] ; then
31    $ROOTCMD update-alternatives --set editor /usr/bin/vim.basic
32    $ROOTCMD update-alternatives --set vi     /usr/bin/vim.basic
33 fi
34
35 if [ -r $target/usr/bin/uxterm ] ; then
36    $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/uxterm
37 elif [ -r $target/usr/bin/xterm ] ; then
38    $ROOTCMD update-alternatives --set x-terminal-emulator /usr/bin/xterm
39 fi
40
41 if [ -r $target/etc/X11/cursors/whiteglass.theme ] ; then
42    $ROOTCMD update-alternatives --set x-cursor-theme /etc/X11/cursors/whiteglass.theme
43 fi
44
45 if [ -r $target/usr/bin/iceweasel ] ; then
46    $ROOTCMD update-alternatives --set x-www-browser /usr/bin/iceweasel
47 fi
48
49 if [ -r $target/usr/bin/w3m ] ; then
50    $ROOTCMD update-alternatives --set www-browser /usr/bin/w3m
51 fi
52
53 ## END OF FILE #################################################################
54 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3