diff options
author | Arun Isaac | 2023-01-29 23:06:52 +0000 |
---|---|---|
committer | Arun Isaac | 2023-01-29 23:06:52 +0000 |
commit | 188d51da3f7078228b3cd57ecbceae658af36048 (patch) | |
tree | f1cea52d8424e4ae2aa88d76ac9eafd54697b08b /bin | |
parent | cb4da55372fae0dd3596b271c9426366d64f0093 (diff) | |
download | tissue-188d51da3f7078228b3cd57ecbceae658af36048.tar.gz tissue-188d51da3f7078228b3cd57ecbceae658af36048.tar.lz tissue-188d51da3f7078228b3cd57ecbceae658af36048.zip |
bin: Allow pulling only one host in each invocation.
* bin/tissue (tissue-pull): Allow pulling only one host in each
invocation.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tissue | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -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) |