[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: refresh: Avoid non-literal format string.
From: |
Ludovic Courtès |
Subject: |
01/01: refresh: Avoid non-literal format string. |
Date: |
Wed, 11 Nov 2015 21:10:32 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 14649b8cdb5708ff99626bbfae194457c465311e
Author: Ludovic Courtès <address@hidden>
Date: Wed Nov 11 22:09:27 2015 +0100
refresh: Avoid non-literal format string.
Reported by Mathieu Lirzin <address@hidden>.
* guix/scripts/refresh.scm (guix-refresh): Rewrite 'list-dependent?'
report to avoid nested 'N_' calls.
---
guix/scripts/refresh.scm | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 8c2ca81..3161aac 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