author | Paul Crowley <paul@lshift.net> |
Fri, 24 Aug 2012 12:04:11 +0100 | |
changeset 360 | 3b4e568ded2c |
parent 314 | c02eae7665af |
child 366 | 660f5631013e |
permissions | -rw-r--r-- |
97 | 1 |
#!/bin/sh |
2 |
# postinst 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 |
|
9 |
case "$1" in |
|
224
caf9cb61f856
Purge repositories if debconf says so.
Paul Crowley <paul@lshift.net>
parents:
116
diff
changeset
|
10 |
configure|reconfigure) |
116
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
11 |
if ! getent passwd hg >/dev/null; then |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
12 |
adduser --disabled-password --quiet --system \ |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
13 |
--shell /bin/sh --group \ |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
14 |
--home /var/lib/mercurial-server \ |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
15 |
--gecos "Mercurial repositories" hg |
291 | 16 |
# Make sure Mercurial's modules will work when we come to use them |
17 |
update-python-modules -p |
|
116
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
18 |
su -c "/usr/share/mercurial-server/init/hginit /usr/share/mercurial-server" hg |
d99f3169828a
Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents:
97
diff
changeset
|
19 |
fi |
97 | 20 |
;; |
21 |
||
22 |
abort-upgrade|abort-remove|abort-deconfigure) |
|
23 |
;; |
|
24 |
||
25 |
*) |
|
26 |
echo "postinst called with unknown argument \`$1'" >&2 |
|
27 |
exit 1 |
|
28 |
;; |
|
29 |
esac |
|
30 |
||
31 |
# dh_installdeb will replace this with shell code automatically |
|
32 |
# generated by other debhelper scripts. |
|
33 |
||
34 |
#DEBHELPER# |
|
35 |
||
36 |
exit 0 |