Handle loading revisions without the (guix lint) module
This is a recent addition, so to support loading revisions without it, better handle the error when loading the module.
This commit is contained in:
parent
15b94238c5
commit
c81d1e04ea
1 changed files with 65 additions and 56 deletions
|
|
@ -199,19 +199,6 @@ WHERE job_id = $1"
|
|||
action time-taken)))))
|
||||
|
||||
(define (all-inferior-lint-warnings inf store)
|
||||
(define checkers
|
||||
(inferior-eval
|
||||
'(begin
|
||||
(use-modules (guix lint))
|
||||
(map (lambda (checker)
|
||||
(list (lint-checker-name checker)
|
||||
(lint-checker-description checker)
|
||||
(if (memq checker %network-dependent-checkers)
|
||||
#t
|
||||
#f)))
|
||||
%all-checkers))
|
||||
inf))
|
||||
|
||||
(define locales
|
||||
'("cs_CZ.utf8"
|
||||
"da_DK.utf8"
|
||||
|
|
@ -286,6 +273,28 @@ WHERE job_id = $1"
|
|||
(check package))))
|
||||
%package-table)))))
|
||||
|
||||
(and
|
||||
(catch
|
||||
'misc-error
|
||||
(lambda ()
|
||||
(inferior-eval '(use-modules (guix lint)) inf)
|
||||
#t)
|
||||
(lambda (key . args)
|
||||
(simple-format (current-error-port)
|
||||
"warning: failed to load the (guix lint) module: ~A ~A\n"
|
||||
key args)
|
||||
#f))
|
||||
(let ((checkers
|
||||
(inferior-eval
|
||||
'(begin
|
||||
(map (lambda (checker)
|
||||
(list (lint-checker-name checker)
|
||||
(lint-checker-description checker)
|
||||
(if (memq checker %network-dependent-checkers)
|
||||
#t
|
||||
#f)))
|
||||
%all-checkers))
|
||||
inf)))
|
||||
(map
|
||||
(match-lambda
|
||||
((name description network-dependent?)
|
||||
|
|
@ -298,7 +307,7 @@ WHERE job_id = $1"
|
|||
(lambda ()
|
||||
(inferior-eval-with-store inf store (lint-warnings-for-checker
|
||||
name))))))))
|
||||
checkers))
|
||||
checkers))))
|
||||
|
||||
(define (all-inferior-package-derivations store inf packages)
|
||||
(define inferior-%supported-systems
|
||||
|
|
@ -815,6 +824,11 @@ WHERE job_id = $1"
|
|||
#t "debug: finished loading information from inferior\n")
|
||||
(close-inferior inf)
|
||||
|
||||
(let ((guix-revision-id
|
||||
(insert-guix-revision conn git-repository-id
|
||||
commit store-path)))
|
||||
|
||||
(when inferior-lint-warnings
|
||||
(let* ((lint-checker-ids
|
||||
(lint-checkers->lint-checker-ids
|
||||
conn
|
||||
|
|
@ -824,30 +838,25 @@ WHERE job_id = $1"
|
|||
conn
|
||||
inferior-package-id->package-database-id
|
||||
lint-checker-ids
|
||||
inferior-lint-warnings))
|
||||
(package-derivation-ids
|
||||
(inferior-data->package-derivation-ids
|
||||
conn inf inferior-package-id->package-database-id
|
||||
inferior-data-4-tuples))
|
||||
(guix-revision-id
|
||||
(insert-guix-revision conn git-repository-id
|
||||
commit store-path)))
|
||||
|
||||
inferior-lint-warnings)))
|
||||
(insert-guix-revision-lint-checkers conn
|
||||
guix-revision-id
|
||||
lint-checker-ids)
|
||||
|
||||
(insert-guix-revision-lint-warnings conn
|
||||
guix-revision-id
|
||||
lint-warning-ids)
|
||||
lint-warning-ids)))
|
||||
(let ((package-derivation-ids
|
||||
(inferior-data->package-derivation-ids
|
||||
conn inf inferior-package-id->package-database-id
|
||||
inferior-data-4-tuples)))
|
||||
|
||||
(insert-guix-revision-package-derivations conn
|
||||
guix-revision-id
|
||||
package-derivation-ids)
|
||||
|
||||
(simple-format
|
||||
#t "Successfully loaded ~A package/derivation pairs\n"
|
||||
(length package-derivation-ids)))))
|
||||
(length package-derivation-ids))))))
|
||||
#t)
|
||||
(lambda (key . args)
|
||||
(simple-format (current-error-port)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue