svn-download, hg-download: Use 'report-invoke-error'.

* guix/build/hg.scm (hg-fetch): Use 'report-invoke-error' instead of
'format'.
* guix/build/svn.scm (svn-fetch): Likewise.
This commit is contained in:
Ludovic Courtès 2020-10-10 00:03:57 +02:00
parent 45cad97d9e
commit b55409b2c0
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 3 additions and 15 deletions

View file

@ -41,13 +41,7 @@ (define* (hg-fetch url changeset directory
(mkdir-p directory)
(guard (c ((invoke-error? c)
(format (current-error-port)
"hg-fetch: '~a~{ ~a~}' failed with exit code ~a~%"
(invoke-error-program c)
(invoke-error-arguments c)
(or (invoke-error-exit-status c)
(invoke-error-stop-signal c)
(invoke-error-term-signal c)))
(report-invoke-error c)
(delete-file-recursively directory)
#f))
(with-directory-excursion directory

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
@ -40,13 +40,7 @@ (define* (svn-fetch url revision directory
"Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a
valid Subversion revision. Return #t on success, #f otherwise."
(guard (c ((invoke-error? c)
(format (current-error-port)
"svn-fetch: '~a~{ ~a~}' failed with exit code ~a~%"
(invoke-error-program c)
(invoke-error-arguments c)
(or (invoke-error-exit-status c)
(invoke-error-stop-signal c)
(invoke-error-term-signal c)))
(report-invoke-error c)
#f))
(apply invoke svn-command
"export" "--non-interactive"