[SCM] Debian packaging of Pinto CPAN distribution branch, master, updated. 6c8a826fc6ae4d3858d42e8e77d9b0df5feb628e
Oleg Gashev
oleg at gashev.net
Wed Jun 5 20:22:22 UTC 2013
The following commit has been merged in the master branch:
commit 6c8a826fc6ae4d3858d42e8e77d9b0df5feb628e
Author: Oleg Gashev <oleg at gashev.net>
Date: Wed Jun 5 20:21:45 2013 +0000
Updated postinst script: update pinto user home folder (use default), added checking file/directory exist before create file/directory.
diff --git a/debian/pinto.postinst b/debian/pinto.postinst
index 418fd2e..40d8d8b 100644
--- a/debian/pinto.postinst
+++ b/debian/pinto.postinst
@@ -5,32 +5,42 @@ set -e
. /usr/share/debconf/confmodule
if [ "$1" = configure ]; then
- lastversion="$2";
-
- getent group pinto >/dev/null 2>&1 || addgroup --system pinto
- getent passwd pinto >/dev/null 2>&1 ||
- adduser --system --home /var/pinto --no-create-home \
- --disabled-password --ingroup pinto pinto
-
- cp -r /usr/share/pinto/new-repository /var/pinto
-
- mkdir -p /var/run/pinto
- chown root:pinto /var/run/pinto
- chmod 0775 /var/run/pinto
-
- mkdir -p /var/log/pinto
- chown pinto:adm /var/log/pinto
- chmod 0750 /var/log/pinto
-
- touch /var/log/pinto/access.log /var/log/pinto/error.log
- chown pinto:adm /var/log/pinto/access.log /var/log/pinto/error.log
- chmod 0640 /var/log/pinto/access.log /var/log/pinto/error.log
-
- if /bin/pidof /usr/bin/pintod >/dev/null 2>&1; then
- invoke-rc.d pinto restart
- else
- invoke-rc.d pinto start
- fi
+ getent group pinto >/dev/null 2>&1 || addgroup --system pinto
+ getent passwd pinto >/dev/null 2>&1 ||
+ adduser --system --no-create-home --disabled-password --ingroup pinto pinto
+
+ if [ ! -e /var/pinto ] ; then
+ cp -r /usr/share/pinto/new-repository /var/pinto
+ fi
+
+ if [ ! -e /var/run/pinto ] ; then
+ mkdir -p /var/run/pinto
+ chown root:pinto /var/run/pinto
+ chmod 0775 /var/run/pinto
+ fi
+
+ if [ ! -e /var/log/pinto ] ; then
+ mkdir -p /var/log/pinto
+ chown pinto:adm /var/log/pinto
+ chmod 0750 /var/log/pinto
+ fi
+
+ if [ ! -e /var/log/pinto/access.log ] ; then
+ touch /var/log/pinto/access.log
+ chown pinto:adm /var/log/pinto/access.log
+ chmod 0640 /var/log/pinto/access.log
+ fi
+
+ if [ ! -e /var/log/pinto/error.log ] ; then
+ touch /var/log/pinto/error.log
+ chown pinto:adm /var/log/pinto/error.log
+ chmod 0640 /var/log/pinto/error.log
+ fi
+ if /bin/pidof /usr/bin/pintod >/dev/null 2>&1; then
+ invoke-rc.d pinto restart
+ else
+ invoke-rc.d pinto start
+ fi
fi
db_stop
--
Debian packaging of Pinto CPAN distribution
More information about the Pkg-perl-cvs-commits
mailing list