debian/postinst
author Paul Crowley <paul@lshift.net>
Tue, 27 Sep 2011 16:48:55 +0100
changeset 345 f06d9816272d
parent 314 c02eae7665af
child 366 660f5631013e
permissions -rw-r--r--
Documentation update - make it clear that you have to have an existing repo to clone - don't try to put the same key in different directories - explain the .mercurial-server file.
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
291
32dba1a70a54 Fix bug 604213
Paul Crowley <paul@lshift.net>
parents: 224
diff changeset
    16
            # Make sure Mercurial's modules will work when we come to use them
32dba1a70a54 Fix bug 604213
Paul Crowley <paul@lshift.net>
parents: 224
diff changeset
    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
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    20
    ;;
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
    abort-upgrade|abort-remove|abort-deconfigure)
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
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    25
    *)
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    26
        echo "postinst called with unknown argument \`$1'" >&2
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    27
        exit 1
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
esac
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    30
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    31
# dh_installdeb will replace this with shell code automatically
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    32
# generated by other debhelper scripts.
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
#DEBHELPER#
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    35
7953788881a4 Start work on Debianization
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    36
exit 0