~ubuntu-branches/ubuntu/maverick/policycoreutils/maverick

« back to all changes in this revision

Viewing changes to debian/prerm

  • Committer: Bazaar Package Importer
  • Author(s): Manoj Srivastava
  • Date: 2005-03-17 19:54:20 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050317195420-ue1cxmipm7mm9ie7
Tags: 1.22+0-2
* New upstream release
* Bug fix: "policycoreutils: package description typo(s) and the like",
  thanks to Florian Zumbiehl                         (Closes: #300054).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#                               -*- Mode: Sh -*- 
 
3
# prerm --- 
 
4
# Author           : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com ) 
 
5
# Created On       : Fri Nov 14 12:16:39 2003
 
6
# Created On Node  : glaurung.green-gryphon.com
 
7
# Last Modified By : Manoj Srivastava
 
8
# Last Modified On : Mon Dec  1 23:18:58 2003
 
9
# Last Machine Used: glaurung.green-gryphon.com
 
10
# Update Count     : 8
 
11
# Status           : Unknown, Use with caution!
 
12
# HISTORY          : 
 
13
# Description      : 
 
14
#
 
15
# arch-tag: a4c1a888-137d-4800-98f8-93d0365422d8 
 
16
 
17
# This program is free software; you can redistribute it and/or modify
 
18
# it under the terms of the GNU General Public License as published by
 
19
# the Free Software Foundation; either version 2 of the License, or
 
20
# (at your option) any later version.
 
21
#
 
22
# This program is distributed in the hope that it will be useful,
 
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
25
# GNU General Public License for more details.
 
26
#
 
27
# You should have received a copy of the GNU General Public License
 
28
# along with this program; if not, write to the Free Software
 
29
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
30
#
 
31
 
32
 
 
33
# Abort if any command returns an error value
 
34
set -e
 
35
 
 
36
package_name=skeleton
 
37
 
 
38
if [ -z "$package_name" ]; then
 
39
    print >&2 "Internal Error. Please report a bug."
 
40
    exit 1;
 
41
fi
 
42
 
 
43
 
 
44
# This script is called as the first step in removing the package from
 
45
# the system.  This includes cases where the user explicitly asked for
 
46
# the package to be removed, upgrade, automatic removal due to conflicts,
 
47
# and deconfiguration due to temporary removal of a depended-on package.
 
48
 
 
49
# Info files should be uninstalled from the dir file in any case.
 
50
##: install-info --quiet --remove /usr/info/${package_name}.info
 
51
 
 
52
case "$1" in
 
53
  remove)
 
54
    # This package about to be removed.
 
55
    :
 
56
 
 
57
    # Remove package-specific directories from /usr/local.  Don't try
 
58
    # to remove standard directories such as /usr/local/lib.
 
59
    ##: if test -d /usr/local/lib/${package_name}; then
 
60
    ##:   rmdir /usr/local/lib/${package_name} || true
 
61
    ##: fi
 
62
 
 
63
    # Deactivate menu-methods script.
 
64
    ##: chmod a-x /etc/menu-methods/${package_name}
 
65
 
 
66
    # Withdraw our version of a program.
 
67
    ##: update-alternatives --remove program /usr/bin/alternative
 
68
 
 
69
    # Get rid of the installed docs
 
70
    ##: if which install-docs >/dev/null 2>&1; then
 
71
    ##:     install-docs -r $package_name
 
72
    ##: fi
 
73
    
 
74
    # Get rid of the byte compiled files
 
75
    ##: if [ -x /usr/lib/emacsen-common/emacs-package-remove ]; then
 
76
    ##:      /usr/lib/emacsen-common/emacs-package-remove $package_name
 
77
    ##: fi
 
78
 
 
79
    if [ -L /usr/doc/$package_name ]; then
 
80
        rm -f /usr/doc/$package_name
 
81
    fi
 
82
 
 
83
    # There are two sub-cases:
 
84
    if test "${2+set}" = set; then
 
85
      if test "$2" != in-favour; then
 
86
        echo "$0: undocumented call to \`prerm $*'" 1>&2
 
87
        exit 0
 
88
      fi
 
89
      # We are being removed because of a conflict with package $3
 
90
      # (version $4), which is now being installed.
 
91
      :
 
92
 
 
93
    else
 
94
      # The package is being removed in its own right.
 
95
      :
 
96
 
 
97
    fi ;;
 
98
  deconfigure)
 
99
    if test "$2" != in-favour -o "$5" != removing; then
 
100
      echo "$0: undocumented call to \`prerm $*'" 1>&2
 
101
      exit 0
 
102
    fi
 
103
    # Package $6 (version $7) which we depend on is being removed due
 
104
    # to a conflict with package $3 (version $4), and this package is
 
105
    # being deconfigured until $6 can be reinstalled.
 
106
    :
 
107
 
 
108
    ;;
 
109
  upgrade)
 
110
    # Prepare to upgrade FROM THIS VERSION of this package to version $2.
 
111
    :
 
112
 
 
113
    if [ -L /usr/doc/$package_name ]; then
 
114
        rm -f /usr/doc/$package_name
 
115
    fi
 
116
 
 
117
    ;;
 
118
  failed-upgrade)
 
119
    # Prepare to upgrade from version $2 of this package TO THIS VERSION.
 
120
    # This is only used if the old version's prerm couldn't handle it,
 
121
    # and returned non-zero.  (Fix old prerm bugs here.)
 
122
    :
 
123
 
 
124
    ;;
 
125
  *) echo "$0: didn't understand being called with \`$1'" 1>&2
 
126
     exit 0;;
 
127
esac
 
128
 
 
129
exit 0