debian/postinst
author Paul Crowley <paul@lshift.net>
Sat, 18 Dec 2010 14:10:46 +0000
branchdebian
changeset 288 2e956ebc2500
parent 224 caf9cb61f856
child 291 32dba1a70a54
permissions -rw-r--r--
Merge in NMU
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
97
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     1
#!/bin/sh
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     2
# postinst script for mercurial-server
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     3
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     4
set -e
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     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
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     8
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     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
d99f3169828a Looks like the start of a working Debianization
Paul Crowley <paul@lshift.net>
parents: 97
diff changeset
    16
            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
    17
        fi
97
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    18
    ;;
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    19
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    20
    abort-upgrade|abort-remove|abort-deconfigure)
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    21
    ;;
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    22
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    23
    *)
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    24
        echo "postinst called with unknown argument \`$1'" >&2
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    25
        exit 1
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    26
    ;;
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    27
esac
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    28
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    29
# dh_installdeb will replace this with shell code automatically
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    30
# generated by other debhelper scripts.
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    31
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    32
#DEBHELPER#
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    33
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    34
exit 0
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    35