Debconf doesn't like message on stdout

This commit is contained in:
Jérôme Schneider 2013-11-20 12:26:53 +01:00
parent 7906dff99c
commit 54c385fe58
2 changed files with 21 additions and 27 deletions

View File

@ -1,9 +1,7 @@
#!/bin/sh
# config maintainer script for foo-pgsql
set -x
export DEBCONF_DEBUG=developer
export dbc_debug=1
set -e
# source debconf stuff
. /usr/share/debconf/confmodule

View File

@ -4,39 +4,48 @@
#
set -e
set -x
export DEBCONF_DEBUG=developer
export dbc_debug=1
AUTHENTIC_USER=authentic
AUTHENTIC_GROUP=authentic
AUTHENTIC_HOME=/var/lib/authentic2
# source debconf stuff
. /usr/share/debconf/confmodule
case "$1" in
configure)
if ! getent group $AUTHENTIC_GROUP > /dev/null 2>&1; then
echo -n "Adding group $AUTHENTIC_GROUP.."
echo -n "Adding group $AUTHENTIC_GROUP.." >&2
addgroup --quiet --system $AUTHENTIC_GROUP
echo "..done"
echo "..done" >&2
fi
if ! getent passwd $AUTHENTIC_USER > /dev/null 2>&1; then
echo -n "Adding user $AUTHENTIC_USER.."
echo -n "Adding user $AUTHENTIC_USER.." >&2
adduser --quiet --system --gecos "Pootle daemon" \
--ingroup $AUTHENTIC_GROUP \
--no-create-home --home $AUTHENTIC_HOME \
$AUTHENTIC_USER
echo "..done"
echo "..done" >&2
fi
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /var/lib/authentic2 /var/run/authentic2 /var/log/authentic2
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /var/lib/authentic2/static /var/lib/authentic2/extra-static
chown $AUTHENTIC_USER:$AUTHENTIC_GROUP /var/lib/authentic2/media
echo -n "Generating static files.."
su authentic -p -c "/usr/bin/authentic2-ctl collectstatic --noinput --link"
echo "..done"
# source dbconfig-common shell library, and call the hook function
if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/postinst.pgsql
dbc_generate_include="template:/etc/authentic2/db.conf"
dbc_generate_include_args="-o template_infile=/usr/share/authentic2/templates/db.conf -U"
dbc_generate_include_owner="root:authentic"
dbc_generate_include_perms="640"
dbc_pgsql_createdb_encoding="UTF8"
dbc_go authentic2 $@
fi
echo -n "Generating static files.." >&2
su authentic -p -c "/usr/bin/authentic2-ctl collectstatic --noinput --link" >&2
echo "..done" >&2
;;
reconfigure|abort-upgrade|abort-remove|abort-deconfigure)
@ -48,19 +57,6 @@ case "$1" in
;;
esac
# source debconf stuff
. /usr/share/debconf/confmodule
# source dbconfig-common shell library, and call the hook function
if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
. /usr/share/dbconfig-common/dpkg/postinst.pgsql
dbc_debug=1
dbc_generate_include="template:/etc/authentic2/db.conf"
dbc_generate_include_args="-o template_infile=/usr/share/authentic2/templates/db.conf -U"
dbc_generate_include_owner="authentic"
dbc_generate_include_perms="640"
dbc_pgsql_createdb_encoding="UTF8"
dbc_go authentic2 $@
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.