guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/05: refresh: Use the standard diagnostic procedures.


From: guix-commits
Subject: 02/05: refresh: Use the standard diagnostic procedures.
Date: Sat, 17 Aug 2019 17:18:25 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 4496ea74aaf9d2497ac3eaf8f780a250bed24503
Author: Ludovic Courtès <address@hidden>
Date:   Sat Aug 17 22:48:26 2019 +0200

    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'.
---
 guix/scripts/refresh.scm | 45 ++++++++++++++++++++-------------------------
 1 file changed, 20 insertions(+), 25 deletions(-)

diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index dd7026a..4591d0f 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -285,10 +285,9 @@ update would trigger a complete rebuild."
   (exit 0))
 
 (define (warn-no-updater package)
-  (format (current-error-port)
-          (G_ "~a: warning: no updater for ~a~%")
-          (location->string (package-location package))
-          (package-name package)))
+  (warning (package-location package)
+           (G_ "no updater for ~a~%")
+           (package-name package)))
 
 (define* (update-package store package updaters
                          #:key (key-download 'interactive) warn?)
@@ -306,11 +305,10 @@ warn about packages that have no matching updater."
         (when version
           (if (and=> tarball file-exists?)
               (begin
-                (format (current-error-port)
-                        (G_ "~a: ~a: updating from version ~a to version 
~a...~%")
-                        (location->string loc)
-                        (package-name package)
-                        (package-version package) version)
+                (info loc
+                      (G_ "~a: updating from version ~a to version ~a...~%")
+                      (package-name package)
+                      (package-version package) version)
                 (for-each
                  (lambda (change)
                    (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)
                               (package-version package))
          ((>)
-          (format (current-error-port)
-                  (G_ "~a: ~a would be upgraded from ~a to ~a~%")
-                  (location->string loc)
-                  (package-name package) (package-version package)
-                  (upstream-source-version source)))
+          (info loc
+                (G_ "~a would be upgraded from ~a to ~a~%")
+                (package-name package) (package-version package)
+                (upstream-source-version source)))
          ((=)
           (when warn?
-            (format (current-error-port)
-                    (G_ "~a: info: ~a is already the latest version of ~a~%")
-                    (location->string loc)
-                    (package-version package)
-                    (package-name package))))
+            (info loc
+                  (G_ "~a is already the latest version of ~a~%")
+                  (package-version package)
+                  (package-name package))))
          (else
           (when warn?
-            (format (current-error-port)
-                    (G_ "~a: warning: ~a is greater than \
+            (warning loc
+                     (G_ "~a is greater than \
 the latest known version of ~a (~a)~%")
-                    (location->string loc)
-                    (package-version package)
-                    (package-name package)
-                    (upstream-source-version source)))))))
+                     (package-version package)
+                     (package-name package)
+                     (upstream-source-version source)))))))
     (#f
      (when warn?
        (warn-no-updater package)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]