summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/tissue29
1 files changed, 19 insertions, 10 deletions
diff --git a/bin/tissue b/bin/tissue
index 0d0d162..5357c66 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -472,16 +472,25 @@ Pull latest from upstream repositories.
"State directory ~a does not exist.~%"
state-directory)
(exit #f))
- ;; Pull state for specific host, or for all hosts when none
- ;; are specified on the command-line.
- (for-each (match-lambda
- ((hostname . parameters)
- (when (or (not (assq-ref args 'host))
- (string=? hostname (assq-ref args 'host)))
- (pull state-directory
- hostname
- (assq-ref parameters 'upstream-repository)))))
- (assq-ref args 'hosts)))))))
+ ;; Pull state for specificied host.
+ ;; It is not a good idea to pull for all configured hosts
+ ;; when no host is specified on the command line. Since
+ ;; pulling requires executing code in each repository,
+ ;; pulling for multiple hosts in a single process can cause
+ ;; interaction of code across hosts.
+ (let ((hostname (assq-ref args 'host)))
+ (cond
+ ((assoc-ref (assq-ref args 'hosts)
+ hostname)
+ => (lambda (parameters)
+ (pull state-directory
+ hostname
+ (assq-ref parameters 'upstream-repository))))
+ (else
+ (format (current-error-port)
+ "Host ~a not found in configuration file."
+ hostname)
+ (exit #f)))))))))
(define (main . args)
(guard (c ((condition-git-error c)