author | Paul Crowley <paul@lshift.net> |
Wed, 02 Dec 2009 18:29:26 +0000 | |
branch | debian |
changeset 233 | 60c2d676a754 |
parent 224 | caf9cb61f856 |
child 261 | b6e65bddda7c |
permissions | -rw-r--r-- |
97 | 1 |
#!/bin/sh |
2 |
# postrm script for mercurial-server |
|
3 |
||
4 |
set -e |
|
5 |
||
224
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
6 |
# Load debconf |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
7 |
. /usr/share/debconf/confmodule |
97 | 8 |
|
224
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
9 |
# Check if the user wants the repositories removed on purging |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
10 |
remove_repositories_on_purge() { |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
11 |
db_get mercurial-server/purge_repositories || RET=false |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
12 |
if [ "$RET" = "true" ]; then |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
13 |
return 0 |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
14 |
else |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
15 |
return 1 |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
16 |
fi |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
17 |
} |
97 | 18 |
|
19 |
case "$1" in |
|
116
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
20 |
purge) |
224
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
21 |
if remove_repositories_on_purge; then |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
22 |
echo -n "Removing hg user and purging data..." |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
23 |
deluser --remove-home --quiet --system hg > /dev/null || true |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
24 |
else |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
25 |
echo -n "Removing hg user..." |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
26 |
deluser --quiet --system hg > /dev/null || true |
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
27 |
fi |
116
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
28 |
delgroup --quiet --system hg > /dev/null || true |
224
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
29 |
echo done |
116
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
30 |
;; |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
31 |
|
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
32 |
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
97 | 33 |
;; |
34 |
||
35 |
*) |
|
36 |
echo "postrm called with unknown argument \`$1'" >&2 |
|
37 |
exit 1 |
|
38 |
;; |
|
39 |
esac |
|
40 |
||
41 |
# dh_installdeb will replace this with shell code automatically |
|
42 |
# generated by other debhelper scripts. |
|
43 |
||
44 |
#DEBHELPER# |
|
45 |
||
46 |
exit 0 |
|
47 |