diff options
author | Nikita Karetnikov <nikita@karetnikov.org> | 2013-04-21 08:08:40 +0000 |
---|---|---|
committer | Nikita Karetnikov <nikita@karetnikov.org> | 2013-04-21 08:08:40 +0000 |
commit | 98eb8cbe8d0bdebde0e151bfb309aa27abaef4d7 (patch) | |
tree | 06e5cc14de272e1e973be23c8bd3979a24e9a302 /guix/gnu-maintenance.scm | |
parent | c6d7e299ae0acb14c76465c7036fdbddf2ef495e (diff) |
ui: Add a 'define-diagnostic' macro.
* guix/ui.scm (define-diagnostic): New macro, which is based on the
previous version of 'warning'.
(warning, leave): Redefine using 'define-diagnostic'.
(report-error): New macro.
(install-locale): Use 'warning' instead of 'format'.
(call-with-error-handling): Adjust 'leave'.
* gnu/packages.scm (package-files): Use 'warning' instead of 'format'.
* guix/gnu-maintenance.scm (http-fetch): Use 'warning' and 'leave'.
* guix/scripts/build.scm (derivations-from-package-expressions, guix-build):
Adjust 'leave'.
* guix/scripts/download.scm (guix-download): Adjust 'leave'.
* guix/scripts/gc.scm (size->number, %options): Adjust 'leave'.
* guix/scripts/package.scm (roll-back, guix-package): Adjust 'leave'.
* po/POTFILES.in: Add 'guix/gnu-maintenance.scm'.
Diffstat (limited to 'guix/gnu-maintenance.scm')
-rw-r--r-- | guix/gnu-maintenance.scm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 89e7f25589..0dc2fab092 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-26) #:use-module (system foreign) #:use-module (guix ftp-client) + #:use-module (guix ui) #:use-module (guix utils) #:use-module (guix packages) #:export (gnu-package-name @@ -84,12 +85,11 @@ ;; (see <http://lists.gnu.org/archive/html/guile-devel/2011-09/msg00089.html>). ;; Since users may still be using these versions, warn them and ;; bail out. - (format (current-error-port) - "warning: using Guile ~a, ~a ~s encoding~%" - (version) - "which does not support HTTP" - (response-transfer-encoding resp)) - (error "download failed; use a newer Guile" + (warning (_ "using Guile ~a, ~a ~s encoding~%") + (version) + "which does not support HTTP" + (response-transfer-encoding resp)) + (leave (_ "download failed; use a newer Guile~%") uri resp))) ((string? data) ; old `http-get' returns a string (open-input-string data)) |