~ubuntu-branches/ubuntu/gutsy/mplayer-skins/gutsy

« back to all changes in this revision

Viewing changes to debian/preinst

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-01-12 23:42:51 UTC
  • Revision ID: james.westby@ubuntu.com-20060112234251-hak59rvno4sn6xjw
Tags: 2-5
dont fail if /usr/share/mplayer/Skins/default is already a symlink

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# preinst script for foo
 
3
#
 
4
# see: dh_installdeb(1)
 
5
 
 
6
set -e
 
7
 
 
8
# summary of how this script can be called:
 
9
#        * <new-preinst> `install'
 
10
#        * <new-preinst> `install' <old-version>
 
11
#        * <new-preinst> `upgrade' <old-version>
 
12
#        * <old-preinst> `abort-upgrade' <new-version>
 
13
#
 
14
# for details, see http://www.debian.org/doc/debian-policy/ or
 
15
# the debian-policy package
 
16
 
 
17
DEFAULTDIR=/usr/share/mplayer/Skin/default
 
18
 
 
19
case "$1" in
 
20
    install|upgrade)
 
21
 
 
22
        # if already a symlink, everything is ok
 
23
        if [ -h ${DEFAULTDIR} ]; then
 
24
                exit 0;
 
25
        fi
 
26
 
 
27
        # remove obsolete directory
 
28
        if [ -d ${DEFAULTDIR} ]; then
 
29
                echo Removing obsolete ${DEFAULTDIR}
 
30
                rmdir ${DEFAULTDIR}
 
31
        fi
 
32
    ;;
 
33
 
 
34
    abort-upgrade)
 
35
    ;;
 
36
 
 
37
    *)
 
38
        echo "preinst called with unknown argument \`$1'" >&2
 
39
        exit 1
 
40
    ;;
 
41
esac
 
42
 
 
43
# dh_installdeb will replace this with shell code automatically
 
44
# generated by other debhelper scripts.
 
45
 
 
46
#DEBHELPER#
 
47
 
 
48
exit 0
 
49
 
 
50