summary refs log tree commit diff
path: root/build-aux/sync-descriptions.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-09-13 15:26:37 +0200
committerLudovic Courtès <ludo@gnu.org>2014-09-13 15:26:37 +0200
commitbed035c56060d008abbfcd7e4100f6aa76031314 (patch)
treef7414dc4601b802fa06ad72aad299442c4d2ecb2 /build-aux/sync-descriptions.scm
parent6bddfbc98d0f76eb9e7bb14402d3792c1e72a31a (diff)
downloadguix-bed035c56060d008abbfcd7e4100f6aa76031314.tar.gz
sync-descriptions: Improve output of proposed descriptions.
* build-aux/sync-descriptions.scm (escape-quotes): New procedure.
  Use it.  Add quotes around the proposed description.
Diffstat (limited to 'build-aux/sync-descriptions.scm')
-rw-r--r--build-aux/sync-descriptions.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/build-aux/sync-descriptions.scm b/build-aux/sync-descriptions.scm
index 61362a1f88..6ff549c309 100644
--- a/build-aux/sync-descriptions.scm
+++ b/build-aux/sync-descriptions.scm
@@ -47,6 +47,16 @@
                          result))
                    '())))
 
+(define (escape-quotes str)
+  "Replace any quote character in STR by an escaped quote character."
+  (list->string
+   (string-fold-right (lambda (chr result)
+                        (match chr
+                          (#\" (cons* #\\ #\"result))
+                          (_   (cons chr result))))
+                      '()
+                      str)))
+
 ;; Iterate over GNU packages.  Report those whose synopsis defers from that
 ;; found upstream.
 (for-each (match-lambda
@@ -69,7 +79,7 @@
                          (not (string=? (fill-paragraph upstream 100)
                                         (fill-paragraph downstream 100))))
                 (format (guix-warning-port)
-                        "~a: ~a: proposed description:~%      ~a~%"
+                        "~a: ~a: proposed description:~%     \"~a\"~%"
                         (location->string loc) (package-name package)
-                        (fill-paragraph upstream 77 7))))))
+                        (fill-paragraph (escape-quotes upstream) 77 7))))))
           gnus)