1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#!/bin/sh
set -e
package=viewcvs
. /usr/share/debconf/confmodule
if [ "$1" = "configure" ]; then
if [ ! -f /etc/viewcvs/viewcvs.conf ]; then
mkdir -p /etc/viewcvs/
cp /etc/viewcvs/viewcvs.conf.default /etc/viewcvs/viewcvs.conf
fi
if [ -n "`/usr/lib/viewcvs/viewcvs-config --all --section vhosts 2>/dev/null`" ]; then
echo not using debconf values since configuration file is too complex
exit 0
fi
if [ "`md5sum /etc/viewcvs/viewcvs.conf`" != "`md5sum /etc/viewcvs/viewcvs.conf.default`" ]; then
cp /etc/viewcvs/viewcvs.conf /etc/viewcvs/viewcvs.conf.dpkg-old
fi
db_get viewcvs/cvsroots
cvs_roots=$RET
db_get viewcvs/svnroots
svn_roots=$RET
# db_get viewcvs/svnparentpath
# svn_parent_path=$RET
rootlist=`echo $cvs_roots $svn_roots | awk '{ gsub(/:[^,]*/, "") ; print }'`
db_subst viewcvs/defaultroot rootlist $rootlist
db_get viewcvs/defaultroot
default_root=$RET
db_get viewcvs/address
# address=`echo $RET | sed -e 's!\(.*\):[[:space:]]\(.*\)!<a href="mailto:\1">\2</a>!g'`
address=$RET
db_get viewcvs/forbidden
forbidden=$RET
db_get viewcvs/allow_tar
if [ "$RET" = "false" ]; then
allow_tar="0"
else
allow_tar="1"
fi
if [ -x /usr/lib/viewcvs/viewcvs-config ]; then
/usr/lib/viewcvs/viewcvs-config -k cvs_roots -v "$cvs_roots"
/usr/lib/viewcvs/viewcvs-config -k svn_roots -v "$svn_roots"
# /usr/lib/viewcvs/viewcvs-config -k svn_parent_path -v "$svn_parent_path"
/usr/lib/viewcvs/viewcvs-config -k default_root -v "$default_root"
/usr/lib/viewcvs/viewcvs-config -k address -v "$address"
/usr/lib/viewcvs/viewcvs-config -k forbidden -v "$forbidden"
/usr/lib/viewcvs/viewcvs-config -k allow_tar -v "$allow_tar"
fi
fi
#DEBHELPER#
|