summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/import/utils.scm8
-rw-r--r--tests/import-utils.scm10
2 files changed, 14 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."
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 221866e871..273f18254e 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -31,6 +31,16 @@
(test-begin "import-utils")
+(test-equal "beautify-description: empty string"
+ "This package lacks a description. Run \
+\"info '(guix) Synopses and Descriptions'\" for more information."
+ (beautify-description ""))
+
+(test-equal "beautify-description: not a string"
+ "This package lacks a description. Run \
+\"info '(guix) Synopses and Descriptions'\" for more information."
+ (beautify-description '()))
+
(test-equal "beautify-description: use double spacing"
"\
Trust me Mr. Hendrix, M. Night Shyamalan et al. \