aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-build-coordinator/hooks.scm47
1 files changed, 24 insertions, 23 deletions
diff --git a/guix-build-coordinator/hooks.scm b/guix-build-coordinator/hooks.scm
index b09cefe..97f3311 100644
--- a/guix-build-coordinator/hooks.scm
+++ b/guix-build-coordinator/hooks.scm
@@ -111,29 +111,30 @@
(string-append publish-directory "/"
narinfo-filename)))
- (copy-file nar-location nar-destination)
-
- (call-with-output-file narinfo-location
- (lambda (port)
- (display (narinfo-string
- output-filename
- (assq-ref output 'hash)
- (assq-ref output 'size)
- (vector->list
- (assq-ref output 'references))
- `((lzip ,(stat:size (stat nar-location #f))))
- #:system (datastore-find-derivation-system
- datastore
- derivation-name)
- #:derivation derivation-name
- #:public-key public-key
- #:private-key private-key)
- port)))
-
- (when post-publish-hook
- (post-publish-hook publish-directory
- narinfo-filename
- nar-filename))))
+ (unless (file-exists? narinfo-location)
+ (copy-file nar-location nar-destination)
+
+ (call-with-output-file narinfo-location
+ (lambda (port)
+ (display (narinfo-string
+ output-filename
+ (assq-ref output 'hash)
+ (assq-ref output 'size)
+ (vector->list
+ (assq-ref output 'references))
+ `((lzip ,(stat:size (stat nar-location #f))))
+ #:system (datastore-find-derivation-system
+ datastore
+ derivation-name)
+ #:derivation derivation-name
+ #:public-key public-key
+ #:private-key private-key)
+ port)))
+
+ (when post-publish-hook
+ (post-publish-hook publish-directory
+ narinfo-filename
+ nar-filename)))))
(datastore-list-build-outputs datastore build-id)))))
(define* (build-success-s3-publish-hook