~ubuntu-branches/ubuntu/lucid/timidity/lucid

« back to all changes in this revision

Viewing changes to debian/timidity.prerm

  • Committer: Bazaar Package Importer
  • Author(s): Joost Yervante Damad
  • Date: 2009-09-16 13:53:56 UTC
  • Revision ID: james.westby@ubuntu.com-20090916135356-6dk3fs1flgbgk0os
Tags: 2.13.2-36
Make sure stop is only invoked when init.d script actually
exists (Closes: #546815)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
set -e
3
3
 
4
 
init_failure() {
5
 
        echo The timidity sequencer init script failed.
6
 
        echo If you rely on a running sequencer, please start it manually
 
4
rm_conffile() {
 
5
    local PKGNAME="$1"
 
6
    local CONFFILE="$2"
 
7
 
 
8
    [ -e "$CONFFILE" ] || return 0
 
9
 
 
10
    local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
 
11
    local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
 
12
            sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
 
13
    if [ "$md5sum" != "$old_md5sum" ]; then
 
14
        echo "init.d conffile $CONFFILE has been modified by you."
 
15
        echo "Saving as $CONFFILE.dpkg-bak ..."
 
16
        mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
 
17
    else
 
18
        echo "Removing init.d conffile $CONFFILE ..."
 
19
        rm -f "$CONFFILE"
 
20
    fi
7
21
}
8
22
 
 
23
case "$1" in
 
24
remove)
 
25
    # ...
 
26
;;
 
27
esac
 
28
 
9
29
#DEBHELPER#
10
30
 
11
31
exit 0