diff options
author | Morgan Smith <Morgan.J.Smith@outlook.com> | 2025-04-07 16:53:52 -0400 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-04-15 10:21:33 +0200 |
commit | 0772d36076d686895a43063cdaf18039b2e5d713 (patch) | |
tree | 2e5ee59ddb63aa8a3eb9e03c17b4075a5cd1beb2 /guix/import | |
parent | 47a5cd9f9c0c42da47068f6b568061dd289a57a4 (diff) |
import/utils: beautify-description: Validate argument.
* guix/import/utils.scm (beautify-description): Fix broken check for
non-strings. Add a check for empty strings.
* tests/import-utils.scm: Add two tests.
Change-Id: Idf86df02aeb850fcc8808b7c9251082c1f816656
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/utils.scm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 38c986b4d5..0ef84c9cdf 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -331,9 +331,9 @@ are replaced with dashes." "Improve the package DESCRIPTION by turning a beginning sentence fragment into a proper sentence and by using two spaces between sentences, and wrap lines at LENGTH characters." - (unless (string? description) - (G_ "This package lacks a description. Run \ -\"info '(guix) Synopses and Descriptions'\" for more information.")) + (if (or (not (string? description)) (string=? (string-trim-both description) "")) + (G_ "This package lacks a description. Run \ +\"info '(guix) Synopses and Descriptions'\" for more information.") (let* ((fix-word (lambda (word) @@ -410,7 +410,7 @@ LENGTH characters." ". " ". "))) 'post) - length))) + length)))) (define (beautify-synopsis synopsis) "Improve the package SYNOPSIS." |