refresh: Use the standard diagnostic procedures.

* guix/scripts/refresh.scm (warn-no-updater): Use 'warning' instead of
'format'.
(update-package): Use 'info' and 'warning' instead of 'format'.
This commit is contained in:
Ludovic Courtès 2019-08-17 22:48:26 +02:00
parent 8d64ef567f
commit 4496ea74aa
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 20 additions and 25 deletions

View File

@ -285,10 +285,9 @@ update would trigger a complete rebuild."
(exit 0)) (exit 0))
(define (warn-no-updater package) (define (warn-no-updater package)
(format (current-error-port) (warning (package-location package)
(G_ "~a: warning: no updater for ~a~%") (G_ "no updater for ~a~%")
(location->string (package-location package)) (package-name package)))
(package-name package)))
(define* (update-package store package updaters (define* (update-package store package updaters
#:key (key-download 'interactive) warn?) #:key (key-download 'interactive) warn?)
@ -306,11 +305,10 @@ warn about packages that have no matching updater."
(when version (when version
(if (and=> tarball file-exists?) (if (and=> tarball file-exists?)
(begin (begin
(format (current-error-port) (info loc
(G_ "~a: ~a: updating from version ~a to version ~a...~%") (G_ "~a: updating from version ~a to version ~a...~%")
(location->string loc) (package-name package)
(package-name package) (package-version package) version)
(package-version package) version)
(for-each (for-each
(lambda (change) (lambda (change)
(format (current-error-port) (format (current-error-port)
@ -350,27 +348,24 @@ WARN? is true and no updater exists for PACKAGE, print a warning."
(case (version-compare (upstream-source-version source) (case (version-compare (upstream-source-version source)
(package-version package)) (package-version package))
((>) ((>)
(format (current-error-port) (info loc
(G_ "~a: ~a would be upgraded from ~a to ~a~%") (G_ "~a would be upgraded from ~a to ~a~%")
(location->string loc) (package-name package) (package-version package)
(package-name package) (package-version package) (upstream-source-version source)))
(upstream-source-version source)))
((=) ((=)
(when warn? (when warn?
(format (current-error-port) (info loc
(G_ "~a: info: ~a is already the latest version of ~a~%") (G_ "~a is already the latest version of ~a~%")
(location->string loc) (package-version package)
(package-version package) (package-name package))))
(package-name package))))
(else (else
(when warn? (when warn?
(format (current-error-port) (warning loc
(G_ "~a: warning: ~a is greater than \ (G_ "~a is greater than \
the latest known version of ~a (~a)~%") the latest known version of ~a (~a)~%")
(location->string loc) (package-version package)
(package-version package) (package-name package)
(package-name package) (upstream-source-version source)))))))
(upstream-source-version source)))))))
(#f (#f
(when warn? (when warn?
(warn-no-updater package))))) (warn-no-updater package)))))