Collpase store-item-for-channel in to channel->guix-store-item

This commit is contained in:
Christopher Baines 2020-02-09 21:06:12 +00:00
parent 13b0ebe561
commit 60d53f898f

View file

@ -884,16 +884,18 @@ WHERE job_id = $1"
(build-derivations store (list derivation)))) (build-derivations store (list derivation))))
(derivation->output-path derivation))) (derivation->output-path derivation)))
(define (channel->guix-store-item conn store channel) (define (channel->guix-store-item conn channel)
(catch (catch
#t #t
(lambda () (lambda ()
(with-store store
(set-build-options store #:fallback? #t)
(dirname (dirname
(readlink (readlink
(string-append (channel->manifest-store-item conn (string-append (channel->manifest-store-item conn
store store
channel) channel)
"/bin")))) "/bin")))))
(lambda args (lambda args
(simple-format #t "guix-data-service: load-new-guix-revision: error: ~A\n" args) (simple-format #t "guix-data-service: load-new-guix-revision: error: ~A\n" args)
#f))) #f)))
@ -1177,13 +1179,6 @@ ORDER BY packages.name, packages.version"
#t) #t)
(define (store-item-for-channel conn channel)
(with-store store
(set-build-options store #:fallback? #t)
(channel->guix-store-item conn
store
channel)))
(define (load-new-guix-revision conn git-repository-id commit) (define (load-new-guix-revision conn git-repository-id commit)
(let* ((channel-for-commit (let* ((channel-for-commit
(channel (name 'guix) (channel (name 'guix)
@ -1192,7 +1187,7 @@ ORDER BY packages.name, packages.version"
git-repository-id)) git-repository-id))
(commit commit))) (commit commit)))
(store-item (store-item
(store-item-for-channel conn channel-for-commit))) (channel->guix-store-item conn channel-for-commit)))
(if store-item (if store-item
(let ((guix-revision-id (let ((guix-revision-id
(insert-guix-revision conn git-repository-id (insert-guix-revision conn git-repository-id