[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bricolage-commits
Subject:    [6625] MySQL'ized version.
From:       tamas () bricolage ! cc
Date:       2005-08-31 7:48:11
Message-ID: 20050831074811.26258.qmail () x1 ! develooper ! com
[Download RAW message or body]

Revision: 6625
Author:   tamas
Date:     2005-08-31 00:48:10 -0700 (Wed, 31 Aug 2005)
ViewCVS:  http://viewsvn.bricolage.cc/?rev=6625&view=rev

Log Message:
-----------
MySQL'ized version.

Modified Paths:
--------------
    bricolage/branches/dev_mysql/inst/conf.pl



["r6625-tamas.diff" (r6625-tamas.diff)]

Modified: bricolage/branches/dev_mysql/inst/conf.pl
===================================================================
--- bricolage/branches/dev_mysql/inst/conf.pl	2005-08-31 07:36:19 UTC (rev 6624)
+++ bricolage/branches/dev_mysql/inst/conf.pl	2005-08-31 07:48:10 UTC (rev 6625)
@@ -46,9 +46,12 @@
 our $AP;
 do "./apache.db" or die "Failed to read apache.db : $!";
 our $PG;
-do "./postgres.db" or die "Failed to read postgres.db : $!";
+our $MY;
+-e "./postgres.db" ? do "./postgres.db" : { 
+    -e "./mysql.db" ? do "./mysql.db" : 
+    die "Failed to read postgres.db or mysql.db: $!" };
 our $REQ;
-do "./required.db" or die "Failed to read required.db : $!";
+do "./required.db" or die "Failed to read required.db: $!";
 
 # check if we're upgrading
 our $UPGRADE;
@@ -88,12 +91,27 @@
     set_bric_conf_var(\$conf, SSL_CERTIFICATE_KEY_FILE  => $AP->{ssl_key});
     set_bric_conf_var(\$conf, SYS_USER        => $AP->{user});
     set_bric_conf_var(\$conf, SYS_GROUP       => $AP->{group});
-    set_bric_conf_var(\$conf, DB_NAME         => $PG->{db_name});
-    set_bric_conf_var(\$conf, DBI_USER        => $PG->{sys_user});
-    set_bric_conf_var(\$conf, DBI_PASS        => $PG->{sys_pass});
-    set_bric_conf_var(\$conf, DB_HOST         => $PG->{host_name});
-    set_bric_conf_var(\$conf, DB_PORT         => $PG->{host_port});
 
+    # XXX DBD_TYPE setttings
+    set_bric_conf_var(\$conf, DBD_TYPE        => $DBD_TYPE);
+    if ($DBD_TYPE eq 'Pg') {
+        set_bric_conf_var(\$conf, DB_NAME         => $PG->{db_name});
+        set_bric_conf_var(\$conf, DBI_USER        => $PG->{sys_user});
+        set_bric_conf_var(\$conf, DBI_PASS        => $PG->{sys_pass});
+        set_bric_conf_var(\$conf, DB_HOST         => $PG->{host_name});
+        set_bric_conf_var(\$conf, DB_PORT         => $PG->{host_port});
+    }
+    elsif ($DBD_TYPE eq 'mysql') {
+        set_bric_conf_var(\$conf, DB_NAME         => $MY->{db_name});
+        set_bric_conf_var(\$conf, DBI_USER        => $MY->{sys_user});
+        set_bric_conf_var(\$conf, DBI_PASS        => $MY->{sys_pass});
+        set_bric_conf_var(\$conf, DB_HOST         => $MY->{host_name});
+        set_bric_conf_var(\$conf, DB_PORT         => $MY->{host_port});
+    }
+    else {
+        hard_fail(qq{Cannot accept "$DBD_TYPE" as a value for the database backend type.});
+    }
+
     # path settings
     my $root = $CONFIG->{BRICOLAGE_ROOT};
     set_bric_conf_var(\$conf, APACHE_CONF     => catfile($root, "conf", "httpd.conf"));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic