~ubuntu-branches/ubuntu/jaunty/couchdb/jaunty

« back to all changes in this revision

Viewing changes to debian/postrm

  • Committer: Bazaar Package Importer
  • Author(s): Noah Slater
  • Date: 2008-05-24 16:30:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080524163021-bpkh6s1090i37xy1
Tags: 0.7.3~svn650270-2
* Added release partitioning to database and log directories.
* Corrected postrm maintainer script to not remove logs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# This file is part of the couchdb package.
4
4
 
5
 
# Copyright (C) 2007, 2008 Noah Slater <nslater@bytesexual.org>.
 
5
# Copyright 2008, Noah Slater <nslater@bytesexual.org>
6
6
 
7
7
# Copying and distribution of this file, with or without modification, are
8
8
# permitted in any medium without royalty provided the copyright notice and this
10
10
 
11
11
# Post-removal procedure for the package.
12
12
 
 
13
PACKAGE_VERSION=0.7.3
 
14
 
13
15
remove_file_collection () {
14
 
    # Remove purgeable data files.
15
 
 
16
 
    rm -f /var/log/couchdb/*
17
16
    rm -f /var/run/couchdb.pid
18
17
}
19
18
 
20
19
remove_directory_collection () {
21
 
    # Remove directories that contain non-purgeable data files.
22
 
 
 
20
    rm -fr /var/log/couchdb/$PACKAGE_VERSION
23
21
    if test -d /etc/couchdb; then
24
22
        rmdir --ignore-fail-on-non-empty /etc/couchdb || true
25
23
    fi
 
24
    if test -d /var/lib/couchdb/$PACKAGE_VERSION; then
 
25
        rmdir --ignore-fail-on-non-empty /var/lib/couchdb/$PACKAGE_VERSION || true
 
26
    fi
26
27
    if test -d /var/lib/couchdb; then
27
28
        rmdir --ignore-fail-on-non-empty /var/lib/couchdb || true
28
29
    fi
29
30
}
30
31
 
31
32
delete_administrative_user_group () {
32
 
    # Delete the administrative user and group if exists.
33
 
 
34
33
    if getent passwd couchdb > /dev/null && which deluser > /dev/null; then
35
34
        deluser couchdb
36
35
    fi
40
39
}
41
40
 
42
41
parse_script_option_list () {
43
 
    # Parse arguments passed to the script and take appropriate action.
44
 
 
45
 
    case "$1" in
 
42
    case $1 in
46
43
        purge)
47
44
            remove_file_collection
48
45
            remove_directory_collection