1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 ;;; Report package synopses and descriptions that defer from those found in
24 (use-modules (guix gnu-maintenance)
34 ;; GNU package descriptors from the Womb.
35 (official-gnu-packages))
38 ;; GNU packages available in the distro.
39 (let ((lookup (lambda (p)
40 (find (lambda (descriptor)
41 (equal? (gnu-package-name descriptor)
44 (fold-packages (lambda (package result)
45 (or (and=> (lookup package)
46 (cut alist-cons package <> result))
50 (define (escape-quotes str)
51 "Replace any quote character in STR by an escaped quote character."
53 (string-fold-right (lambda (chr result)
55 (#\" (cons* #\\ #\"result))
56 (_ (cons chr result))))
60 ;; Iterate over GNU packages. Report those whose synopsis defers from that
62 (for-each (match-lambda
63 ((package . descriptor)
64 (let ((upstream (gnu-package-doc-summary descriptor))
65 (downstream (package-synopsis package))
66 (loc (or (package-field-location package 'synopsis)
67 (package-location package))))
68 (unless (and upstream (string=? upstream downstream))
69 (format (guix-warning-port)
70 "~a: ~a: proposed synopsis: ~s~%"
71 (location->string loc) (package-name package)
74 (let ((upstream (gnu-package-doc-description descriptor))
75 (downstream (package-description package))
76 (loc (or (package-field-location package 'description)
77 (package-location package))))
79 (not (string=? (fill-paragraph upstream 100)
80 (fill-paragraph downstream 100))))
81 (format (guix-warning-port)
82 "~a: ~a: proposed description:~% \"~a\"~%"
83 (location->string loc) (package-name package)
84 (fill-paragraph (escape-quotes upstream) 77 7))))))