guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Save the default database.


From: Mathieu Othacehe
Subject: branch master updated: Save the default database.
Date: Tue, 09 Mar 2021 06:01:29 -0500

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix-cuirass.

The following commit(s) were added to refs/heads/master by this push:
     new 265b134  Save the default database.
265b134 is described below

commit 265b134527cdd51cb06fa3a8fd69d7dfa58cb265
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Mar 9 11:52:33 2021 +0100

    Save the default database.
    
    * src/cuirass/database.scm (db-open): Save the default database in the
    %package-database parameter.
---
 src/cuirass/database.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index c692e87..805de5f 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -355,11 +355,12 @@ upgrade-n.sql files."
                   (database (%package-database)))
   "Open database to store or read jobs and builds informations.  Return a
 database object."
-  (let* ((param (or database
-                    (format #f "dbname=~a host=~a"
-                            (%cuirass-database)
-                            (%cuirass-host))))
-         (db (connect-to-postgres-paramstring param)))
+  (unless database
+    (%package-database
+     (format #f "dbname=~a host=~a"
+             (%cuirass-database) (%cuirass-host))))
+
+  (let ((db (connect-to-postgres-paramstring (%package-database))))
     (when (%create-database?)
       (match (db-schema-version db)
         (#f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]