author | Paul Crowley <paul@lshift.net> |
Thu, 08 Sep 2011 10:44:45 +0100 | |
changeset 336 | 5874d49da474 |
parent 314 | c02eae7665af |
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 |
261 | 24 |
delgroup --quiet --system hg > /dev/null || true |
25 |
echo done |
|
224
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
26 |
fi |
116
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
27 |
;; |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
28 |
|
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
29 |
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) |
97 | 30 |
;; |
31 |
||
32 |
*) |
|
33 |
echo "postrm called with unknown argument \`$1'" >&2 |
|
34 |
exit 1 |
|
35 |
;; |
|
36 |
esac |
|
37 |
||
38 |
# dh_installdeb will replace this with shell code automatically |
|
39 |
# generated by other debhelper scripts. |
|
40 |
||
41 |
#DEBHELPER# |
|
42 |
||
43 |
exit 0 |