2002-12-17 16:50:46 +01:00
|
|
|
#! /bin/bash -e
|
|
|
|
#
|
|
|
|
# Debian prerm script for Python x.y hierarchical modules
|
|
|
|
# Written by Gregor Hoffleit <flight@debian.org>
|
|
|
|
# Extended by Matthias Klose <doko@debian.org>
|
|
|
|
#
|
|
|
|
|
2003-04-11 13:59:06 +02:00
|
|
|
PV=`python -c 'import sys; print sys.version[:3]'`
|
2002-12-17 16:50:46 +01:00
|
|
|
|
2003-04-11 13:59:06 +02:00
|
|
|
DIRLIST="/usr/lib/glasnost/glasnost"
|
2002-12-17 16:50:46 +01:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure|abort-upgrade|abort-remove|abort-deconfigure)
|
|
|
|
for i in $DIRLIST ; do
|
|
|
|
/usr/bin/python$PV -O /usr/lib/python$PV/compileall.py -q $i
|
|
|
|
/usr/bin/python$PV /usr/lib/python$PV/compileall.py -q $i
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2003-08-12 01:21:16 +02:00
|
|
|
GLASNOST_USER=glasnost-daemon
|
2002-12-17 16:50:46 +01:00
|
|
|
|
|
|
|
if [ -x /usr/sbin/adduser ]; then
|
|
|
|
id $GLASNOST_USER > /dev/null 2>&1 ||
|
2003-03-05 11:09:45 +01:00
|
|
|
adduser --system --ingroup daemon --home /etc/glasnost/ \
|
2002-12-17 16:50:46 +01:00
|
|
|
--no-create-home $GLASNOST_USER > /dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# migration from 0.4 to 0.5
|
|
|
|
|
|
|
|
if [ "$1" = "configure" -a -n "$2" ] && dpkg --compare-versions "$2" le "0.4.5-1"; then
|
|
|
|
HOST=`grep DefaultDispatcherURL /etc/glasnost/config | cut -d '/' -f 3`
|
|
|
|
VDIR=/var/lib/glasnost/
|
|
|
|
( mkdir $VDIR/$HOST && \
|
|
|
|
mv $VDIR/*.pickle $VDIR/$HOST && \
|
|
|
|
test -d $VDIR/articles && mv $VDIR/articles $VDIR/$HOST && \
|
|
|
|
test -d $VDIR/books && mv $VDIR/books $VDIR/$HOST && \
|
|
|
|
test -d $VDIR/uploadfiles && mv $VDIR/uploadfiles $VDIR/$HOST ) || ( \
|
|
|
|
echo "Automatic upgrade failed; sorry." && \
|
|
|
|
echo "Glasnost probably won't start, you should edit /etc/glasnost/config" && \
|
|
|
|
echo "and check the Dispatchers line" && \
|
|
|
|
echo "(see http://www.entrouvert.org/articles/217 for more informations)" )
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2003-06-30 22:26:58 +02:00
|
|
|
test -d /var/lib/glasnost || mkdir /var/lib/glasnost
|
2002-12-17 16:50:46 +01:00
|
|
|
chown -R $GLASNOST_USER /var/lib/glasnost/
|
2003-06-30 22:26:58 +02:00
|
|
|
|
|
|
|
test -d /var/log/glasnost || mkdir /var/log/glasnost
|
2002-12-17 16:50:46 +01:00
|
|
|
chown -R $GLASNOST_USER /var/log/glasnost/
|
2003-06-30 22:26:58 +02:00
|
|
|
|
|
|
|
test -d /var/lib/glasnost/webcache || mkdir /var/lib/glasnost/webcache
|
2004-02-29 22:49:31 +01:00
|
|
|
chown -R www-data.www-data /var/lib/glasnost/webcache/
|
2002-12-17 16:50:46 +01:00
|
|
|
|
2003-10-16 12:32:17 +02:00
|
|
|
/usr/sbin/glasnost-ctl compile-tal /var/lib/glasnost/templates/
|
2003-09-28 18:21:09 +02:00
|
|
|
|
2002-12-17 16:50:46 +01:00
|
|
|
#DEBHELPER#
|
|
|
|
|