[interchange-cvs] interchange - racke modified 3 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Jul 27 03:39:46 EDT 2006


User:      racke
Date:      2006-07-27 07:39:46 GMT
Modified:  debian   control interchange-cat-standard.config
Modified:           interchange-cat-standard.postinst
Log:
introduced dbconfig-common for configuring database (work in progress)

Revision  Changes    Path
2.22      +1 -1      interchange/debian/control


rev 2.22, prev_rev 2.21
Index: control
===================================================================
RCS file: /var/cvs/interchange/debian/control,v
retrieving revision 2.21
retrieving revision 2.22
diff -u -r2.21 -r2.22
--- control	28 Oct 2005 09:48:06 -0000	2.21
+++ control	27 Jul 2006 07:39:46 -0000	2.22
@@ -7,7 +7,7 @@
 
 Package: interchange-cat-standard
 Architecture: all
-Depends: libwww-perl, debconf | debconf-2.0, interchange (>=5.3.0), interchange-ui (>=5.3.0), libdbd-mysql-perl | libdbd-pg-perl
+Depends: libwww-perl, debconf | debconf-2.0, interchange (>=5.3.0), interchange-ui (>=5.3.0), libdbd-mysql-perl | libdbd-pg-perl, dbconfig-common
 Description: Standard store, a sample Interchange catalog
  The Standard store is a demo catalog which you can use to
  build your Interchange applications from. While the Standard store



2.5       +9 -5      interchange/debian/interchange-cat-standard.config


rev 2.5, prev_rev 2.4
Index: interchange-cat-standard.config
===================================================================
RCS file: /var/cvs/interchange/debian/interchange-cat-standard.config,v
retrieving revision 2.4
retrieving revision 2.5
diff -u -r2.4 -r2.5
--- interchange-cat-standard.config	3 May 2005 14:59:41 -0000	2.4
+++ interchange-cat-standard.config	27 Jul 2006 07:39:46 -0000	2.5
@@ -1,6 +1,6 @@
 #! /bin/sh -e
 #
-# Copyright 2001,2002,2003,2004,2005 by Stefan Hornburg (Racke) <racke at linuxia.de>
+# Copyright 2001,2002,2003,2004,2005,2006 by Stefan Hornburg (Racke) <racke at linuxia.de>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,6 +20,10 @@
 # Source debconf library
 . /usr/share/debconf/confmodule
 
+# Source dbconfig-common stuff
+dbc_dbtypes="mysql, pgsql"
+. /usr/share/dbconfig-common/dpkg/config 
+
 # demo catalog installation
 db_input high interchange-cat-standard/install || [ $? -eq 30 ]
 db_go
@@ -61,15 +65,15 @@
 fi
 
 # database parameters
-db_input high interchange-cat-standard/dbtype || [ $? -eq 30 ]
-db_go
-db_input high interchange-cat-standard/dbname || [ $? -eq 30 ]
-db_go
+dbc_go interchange-cat-standard $@
 
+# catalog admin
 db_input high interchange-cat-standard/username || [ $? -eq 30 ]
 db_go
 db_input high interchange-cat-standard/password || [ $? -eq 30 ]
 db_go
+
+# locales
 db_input medium interchange-cat-standard/locales || [ $? -eq 30 ]
 db_go
 db_get interchange-cat-standard/locales



2.6       +15 -10    interchange/debian/interchange-cat-standard.postinst


rev 2.6, prev_rev 2.5
Index: interchange-cat-standard.postinst
===================================================================
RCS file: /var/cvs/interchange/debian/interchange-cat-standard.postinst,v
retrieving revision 2.5
retrieving revision 2.6
diff -u -r2.5 -r2.6
--- interchange-cat-standard.postinst	3 May 2005 14:59:41 -0000	2.5
+++ interchange-cat-standard.postinst	27 Jul 2006 07:39:46 -0000	2.6
@@ -1,6 +1,6 @@
 #! /bin/sh -e
 #
-# Copyright 2001,2004,2005 by Stefan Hornburg (Racke) <racke at linuxia.de>
+# Copyright 2001,2004,2005,2006 by Stefan Hornburg (Racke) <racke at linuxia.de>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,6 +19,9 @@
 
 # Source debconf library
 . /usr/share/debconf/confmodule
+# Source dbconfig-common library
+. /usr/share/dbconfig-common/dpkg/postinst.mysql 
+dbc_go interchange-cat-standard $@
 
 GOAHEAD=false
 
@@ -80,19 +83,17 @@
 	MYSQL=0
 	PGSQL=0
 	SQLDSN=
-	db_get interchange-cat-standard/dbname
-	DBNAME="$RET"
 	db_get interchange-cat-standard/dbtype
-	if [ "$RET" = "MySQL" ]; then
+	if [ "$dbc_dbtype" = "mysql" ]; then
 		MYSQL=1
-		SQLDSN="dbi:mysql:$DBNAME"
-	elif [ "$RET" = "PostgreSQL" ]; then
+		SQLDSN="dbi:mysql:$dbc_dbname"
+	elif [ "$dbc_dbype" = "pgsql" ]; then
 		PGSQL=1
-		SQLDSN="dbi:Pg:dbname=$DBNAME"
+		SQLDSN="dbi:Pg:dbname=$dbc_dbname"
 	fi
-
+	
 	SERVERNAME=`hostname --fqdn 2>/dev/null || echo localhost`
-	MVC_ENABLESECURE=1 MVC_UISECURE=1 MVC_SUPERUSER="$UI_SUPERUSER" MVC_CRYPTPW="$UI_PASSWORD" MVC_LOCALES="$LOCALES" MVC_DEFAULTLOCALE="$DEFAULTLOCALE" MVC_SKIP_ADD_GLOBAL_USERTAG=1 MVC_MYSQL=$MYSQL MVC_PGSQL=$PGSQL MVC_SQLDB="$DBNAME" MVC_SQLDSN="$SQLDSN" MVC_SQLUSER=interchange /usr/bin/makecat \
+	MVC_ENABLESECURE=1 MVC_UISECURE=1 MVC_SUPERUSER="$UI_SUPERUSER" MVC_CRYPTPW="$UI_PASSWORD" MVC_LOCALES="$LOCALES" MVC_DEFAULTLOCALE="$DEFAULTLOCALE" MVC_SKIP_ADD_GLOBAL_USERTAG=1 MVC_MYSQL=$MYSQL MVC_PGSQL=$PGSQL /usr/bin/makecat \
 		-F \
 		-l /var/log/interchange/makecat.log \
 		--demotype=$CATALOG \
@@ -118,7 +119,11 @@
 		--linkmode=UNIX \
 		--catuser=$USER \
 		--mailorderto=$USER \
-		--nocfg
+		--nocfg \
+		MYSQLCREATE=0 \
+		SQLDSN="$SQLDSN" \
+		SQLUSER="$dbc_dbuser" \
+		SQLPASS="$dbc_dbpass"
 fi
 
 db_get interchange-cat-standard/install








More information about the interchange-cvs mailing list