[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66754: [PATCH] add guix locate database is locked error message
From: |
Maciej Kalandyk |
Subject: |
bug#66754: [PATCH] add guix locate database is locked error message |
Date: |
Sat, 28 Oct 2023 19:11:09 +0200 |
Change-Id: Iebe76c75d45e70317bd18d2c176dcdeaf9d6964c
Signed-off-by: Maciej Kalandyk <m.kalandyk@outlook.com>
---
guix/scripts/locate.scm | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/guix/scripts/locate.scm b/guix/scripts/locate.scm
index 93faa1aea2..a6b6036052 100644
--- a/guix/scripts/locate.scm
+++ b/guix/scripts/locate.scm
@@ -115,13 +115,21 @@ (define schema-to-migrate '((1 . "
")))
(define (call-with-database file proc)
- (let ((db (sqlite-open file)))
- (dynamic-wind
- (lambda () #t)
- (lambda ()
- (ensure-latest-database-schema db)
- (proc db))
- (lambda () (sqlite-close db)))))
+ (catch 'sqlite-error
+ (lambda ()
+ (let ((db (sqlite-open file)))
+ (dynamic-wind
+ (lambda () #t)
+ (lambda ()
+ (ensure-latest-database-schema db)
+ (proc db))
+ (lambda () (sqlite-close db)))))
+ (lambda (key . args)
+ (match args
+ [(_ 5 _)
+ (leave (G_ "database ~a is locked by another process~%")
+ file)]
+ [_ (apply throw (cons key args))]))))
(define (ensure-latest-database-schema db)
"Ensure DB follows the latest known version of the schema."
base-commit: 6d7e181ba18d11c92409a93936025fb46b9c8171
prerequisite-patch-id: 9ba8ba9723e24b3d15f07622ff1c5ae78567f6cd
--
2.41.0