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

List:       bricolage-bugs
Subject:    [Bricolage-Bugs] [Bug 122] New: [PATCH] Impossible to specify a non-local database
From:       bugzilla-daemon () bricolage-bugzilla ! about ! com
Date:       2002-02-27 18:24:08
[Download RAW message or body]

           Summary: [PATCH] Impossible to specify a non-local database
           Product: Bricolage
           Version: 1.2.1 - Current Release
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: API
        AssignedTo: david@wheeler.net
        ReportedBy: mdorman@debian.org


In the current setup it is impossible to specify that the database is running on
a different host from the Bricolage installation.

I believe the following patch addresses this defect, as well as one other
issue---that a constant is being uselessly declared for the DB_NAME parameter,
which is not used in any module but Bric::Config.

I hope this patch will apply cleanly---the )(*^!@#(*&%!@ form is wrapping stuff
badly.

Index: lib/Bric/Config.pm
===================================================================
RCS file: /var/CVS/debian/bricolage/lib/Bric/Config.pm,v
retrieving revision 1.1.1.4
diff -u -u -r1.1.1.4 Config.pm
--- lib/Bric/Config.pm	23 Feb 2002 00:14:54 -0000	1.1.1.4
+++ lib/Bric/Config.pm	27 Feb 2002 23:53:13 -0000
@@ -239,6 +239,12 @@
 	$config->{MASON_COMP_ROOT} ||=
 	  catdir($ENV{BRICOLAGE_ROOT} || '/usr/local/bricolage', 'comp');
 
+        # Set the database name to its default here
+        $config->{DB_NAME} ||= 'sharky';
+
+        # Prefix any host spec with a host tag
+        $config->{DBI_HOST} &&= 'host=' . $config->{DBI_HOST};
+
 	# Grab the Apache configuration file.
 	$config->{APACHE_CONF} ||= '/usr/local/apache/conf/httpd.conf';
 	$aconf = Apache::ConfigFile->new(file => $config->{APACHE_CONF},
@@ -267,8 +273,7 @@
     # DBI Settings.
     use constant DBD_PACKAGE             => 'Bric::Util::DBD::Pg';
     use constant DBD_TYPE                => 'Pg';
-    use constant DB_NAME                 => $config->{DB_NAME} || 'sharky';
-    use constant DSN_STRING              => 'dbname=' . DB_NAME;
+    use constant DSN_STRING              => 'dbname=' . $config->{DB_NAME} .
$config->{DBI_HOST}
     use constant DBI_USER                => $config->{DBI_USER} || 'castellan';
     use constant DBI_PASS                => $config->{DBI_PASS} || 'nalletsac';
     use constant DBI_DEBUG               => $config->{DBI_DEBUG} || 0;

http://bricolage-bugzilla.thepirtgroup.com/show_bug.cgi?id=122

_______________________________________________
Bricolage-Bugs mailing list
Bricolage-Bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

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