git: 'latest-repository-commit' logs its progress.
* guix/git.scm (latest-repository-commit): Add #:log-port and honor it.
This commit is contained in:
parent
2f24b9ca8b
commit
35cb37ea9c
1 changed files with 6 additions and 1 deletions
|
@ -154,6 +154,7 @@ data, respectively [<branch name> | <sha1> | <tag name>]."
|
||||||
|
|
||||||
(define* (latest-repository-commit store url
|
(define* (latest-repository-commit store url
|
||||||
#:key
|
#:key
|
||||||
|
(log-port (%make-void-port "w"))
|
||||||
(cache-directory
|
(cache-directory
|
||||||
(%repository-cache-directory))
|
(%repository-cache-directory))
|
||||||
(ref '(branch . "master")))
|
(ref '(branch . "master")))
|
||||||
|
@ -164,11 +165,14 @@ REF is pair whose key is [branch | commit | tag] and value the associated
|
||||||
data, respectively [<branch name> | <sha1> | <tag name>].
|
data, respectively [<branch name> | <sha1> | <tag name>].
|
||||||
|
|
||||||
Git repositories are kept in the cache directory specified by
|
Git repositories are kept in the cache directory specified by
|
||||||
%repository-cache-directory parameter."
|
%repository-cache-directory parameter.
|
||||||
|
|
||||||
|
Log progress and checkout info to LOG-PORT."
|
||||||
(define (dot-git? file stat)
|
(define (dot-git? file stat)
|
||||||
(and (string=? (basename file) ".git")
|
(and (string=? (basename file) ".git")
|
||||||
(eq? 'directory (stat:type stat))))
|
(eq? 'directory (stat:type stat))))
|
||||||
|
|
||||||
|
(format log-port "updating checkout of '~a'...~%" url)
|
||||||
(let*-values
|
(let*-values
|
||||||
(((checkout commit)
|
(((checkout commit)
|
||||||
(update-cached-checkout url
|
(update-cached-checkout url
|
||||||
|
@ -177,6 +181,7 @@ Git repositories are kept in the cache directory specified by
|
||||||
(url-cache-directory url cache-directory)))
|
(url-cache-directory url cache-directory)))
|
||||||
((name)
|
((name)
|
||||||
(url+commit->name url commit)))
|
(url+commit->name url commit)))
|
||||||
|
(format log-port "retrieved commit ~a~%" commit)
|
||||||
(values (add-to-store store name #t "sha256" checkout
|
(values (add-to-store store name #t "sha256" checkout
|
||||||
#:select? (negate dot-git?))
|
#:select? (negate dot-git?))
|
||||||
commit)))
|
commit)))
|
||||||
|
|
Reference in a new issue