[Fusionforge-commits] r10158 - in trunk/src/debian: . dsf-in

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Jun 30 18:49:44 CEST 2010


Author: lolando
Date: 2010-06-30 18:49:44 +0200 (Wed, 30 Jun 2010)
New Revision: 10158

Modified:
   trunk/src/debian/changelog
   trunk/src/debian/dsf-in/common.postinst
Log:
Automated migration to *.ini-style configuration

Modified: trunk/src/debian/changelog
===================================================================
--- trunk/src/debian/changelog	2010-06-30 15:57:40 UTC (rev 10157)
+++ trunk/src/debian/changelog	2010-06-30 16:49:44 UTC (rev 10158)
@@ -1,8 +1,8 @@
-fusionforge (5.0.50-1) unstable; urgency=low
+fusionforge (5.0.51-1) UNRELEASED; urgency=low
 
   * Snapshot from upstream SVN.
 
- -- Roland Mas <lolando at debian.org>  Tue, 06 Apr 2010 18:30:28 +0200
+ -- Roland Mas <lolando at debian.org>  Tue, 29 Jun 2010 22:53:15 +0200
 
 fusionforge (5.0.1+svn10006-1) unstable; urgency=low
 

Modified: trunk/src/debian/dsf-in/common.postinst
===================================================================
--- trunk/src/debian/dsf-in/common.postinst	2010-06-30 15:57:40 UTC (rev 10157)
+++ trunk/src/debian/dsf-in/common.postinst	2010-06-30 16:49:44 UTC (rev 10158)
@@ -32,6 +32,45 @@
 	adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot scm- at OLDPACKAGE@ > /dev/null 2>&1
 	adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot www- at OLDPACKAGE@ > /dev/null 2>&1
 
+	if [ "$2" = "" ] ; then
+	    # Installation from scratch, let's generate initial config files
+	    if [ ! -e /etc/gforge/config.ini.d/debian-install.ini ] ; then
+		cat > /etc/gforge/config.ini.d/debian-install.ini <<EOF
+; This file was generated by the Debian installation system.
+; You can edit the values here or move them to other files.
+
+[core]
+forge_name=FusionForge
+web_host=$(hostname -f)
+EOF
+	    fi
+	    if [ ! -e /etc/gforge/config.ini.d/debian-install-secrets.ini ] ; then
+		t=$(mktemp /etc/gforge/config.ini.d/debian-install-secrets.ini.XXXXXX)
+		if [ -c /dev/urandom ]; then  # ...using /dev/urandom when possible
+		    pw=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum)
+		else		# ...or something else if need be.
+		    pw=$(date +"%s:%N" | md5sum)
+		fi
+
+		cat > $t <<EOF
+; This file was generated by the Debian installation system.
+; You can edit the values here or move them to other files.
+; These values should not go into world-readable files!
+
+[core]
+database_host=""
+database_name=gforge
+database_user=gforge
+database_port=5432
+database_password=$pw
+EOF
+		mv $t /etc/gforge/config.ini.d/debian-install-secrets.ini
+	    fi
+	elif dpkg --compare-versions $2 lt 5.0.51-1 ; then
+	    # Upgrading from a pre-*.ini system, let's migrate
+	    PATH=$PATH:/usr/share/gforge/bin migrate-to-ini-files.sh
+	fi 
+
 	@OLDPACKAGE at -config
     ;;
 




More information about the Fusionforge-commits mailing list