From c5c1ff9fc8dcb24003569c0a37dcda6fcd1fbee2 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 4 Feb 2022 09:19:54 +0000 Subject: Allow overriding the success publish hook skip publishing behaviour This means that when using the nar-herder, you can get it to check for the presence of the nar in the database, rather than relying on the narinfo on the disk. --- guix-build-coordinator/hooks.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix-build-coordinator/hooks.scm') diff --git a/guix-build-coordinator/hooks.scm b/guix-build-coordinator/hooks.scm index c2c5008..2053e90 100644 --- a/guix-build-coordinator/hooks.scm +++ b/guix-build-coordinator/hooks.scm @@ -82,6 +82,10 @@ (public-key (read-file-sexp %public-key-file)) (private-key (read-file-sexp %private-key-file)) (narinfo-directory publish-directory) + (skip-publishing-proc + (lambda (narinfo-filename narinfo-directory) + (file-exists? (string-append + narinfo-directory "/" narinfo-filename)))) post-publish-hook) (mkdir-p (string-append publish-directory "/nar/lzip")) @@ -116,7 +120,7 @@ (string-append narinfo-directory "/" narinfo-filename))) - (unless (file-exists? narinfo-location) + (unless (skip-publishing-proc narinfo-filename narinfo-directory) (copy-file nar-location nar-destination) (call-with-output-file narinfo-location -- cgit v1.2.3