summaryrefslogtreecommitdiff
path: root/guix/scripts/refresh.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-11 22:09:27 +0100
committerLudovic Courtès <ludo@gnu.org>2015-11-11 22:10:21 +0100
commit14649b8cdb5708ff99626bbfae194457c465311e (patch)
tree863bf532925aab9d2150da89a69dd937fac5c303 /guix/scripts/refresh.scm
parent42f8504ccc7729b536e3137e71eb45806968e41a (diff)
downloadgnu-guix-14649b8cdb5708ff99626bbfae194457c465311e.tar
gnu-guix-14649b8cdb5708ff99626bbfae194457c465311e.tar.gz
refresh: Avoid non-literal format string.
Reported by Mathieu Lirzin <mthl@gnu.org>. * guix/scripts/refresh.scm (guix-refresh): Rewrite 'list-dependent?' report to avoid nested 'N_' calls.
Diffstat (limited to 'guix/scripts/refresh.scm')
-rw-r--r--guix/scripts/refresh.scm30
1 files changed, 17 insertions, 13 deletions
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 8c2ca81175..3161aacfe2 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -322,21 +322,25 @@ update would trigger a complete rebuild."
(package-covering-dependents packages)))
(total-dependents
(length (package-transitive-dependents packages))))
- (if (= total-dependents 0)
- (format (current-output-port)
- (N_ "No dependents other than itself: ~{~a~}~%"
- "No dependents other than themselves: ~{~a~^ ~}~%"
- (length packages))
- (map package-full-name packages))
- (format (current-output-port)
- (N_ (N_ "A single dependent package: ~2*~{~a~}~%"
- "Building the following package would ensure ~d \
-dependent packages are rebuilt; ~*~{~a~^ ~}~%"
- total-dependents)
- "Building the following ~d packages would ensure ~d \
+ (cond ((= total-dependents 0)
+ (format (current-output-port)
+ (N_ "No dependents other than itself: ~{~a~}~%"
+ "No dependents other than themselves: ~{~a~^ ~}~%"
+ (length packages))
+ (map package-full-name packages)))
+
+ ((= total-dependents 1)
+ (format (current-output-port)
+ (_ "A single dependent package: ~{~a~}~%")
+ rebuilds))
+ (else
+ (format (current-output-port)
+ (N_ "Building the following package would ensure ~d \
+dependent packages are rebuilt: ~*~{~a~^ ~}~%"
+ "Building the following ~d packages would ensure ~d \
dependent packages are rebuilt: ~{~a~^ ~}~%"
(length rebuilds))
- (length rebuilds) total-dependents rebuilds))))
+ (length rebuilds) total-dependents rebuilds)))))
(update?
(let ((store (open-connection)))
(parameterize ((%openpgp-key-server