Add a procedure to fix derivation source files

I don't know how, but there are a couple in the data.guix.gnu.org database
that are placeholders.
This commit is contained in:
Christopher Baines 2025-03-11 19:47:14 +00:00
parent 167b7d029e
commit 1181b13ffe

View file

@ -97,7 +97,8 @@
enqueue-load-new-guix-revision-job
most-recent-n-load-new-guix-revision-jobs
fix-derivation))
fix-derivation
fix-derivation-source-file-nar))
(define inferior-package-id
(@@ (guix inferior) inferior-package-id))
@ -1310,6 +1311,30 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
#:hz 0
#:parallelism 1))
(define (fix-derivation-source-file-nar id)
(run-fibers
(lambda ()
(with-postgresql-connection
"fix"
(lambda (conn)
(let ((postgresql-connection-pool
(make-resource-pool
(const conn)
1
#:name "postgres")))
(match (exec-query
conn
"
SELECT store_path FROM derivation_source_files WHERE id = $1"
(list (number->string id)))
(((store-path))
(compute-and-update-derivation-source-file-nar
postgresql-connection-pool
id
store-path)))))))
#:hz 0
#:parallelism 1))
(define* (derivation-file-names->derivation-ids postgresql-connection-pool
call-with-utility-thread
read-derivations/fiberized