Subject: [bug#70715] [PATCH v2 2/3] guix: Include a main verb in crate importer descriptions.

From: Herman Rimm <[email-masked]>
Date: Sun, 12 May 2024 21:08:31 +0200

* guix/import/crate.scm (make-crate-sexp): Start description with
'This package provides '.
* tests/crate.scm: Set descriptions to "This package provides summary".
---
 guix/import/crate.scm |  6 +++++-
 tests/crate.scm       | 36 ++++++++++++++++++------------------
 2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 921e5499da..383a419741 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -187,6 +187,7 @@ (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inpu
          (guix-name (crate-name->package-name name))
          (cargo-inputs (format-inputs cargo-inputs))
          (cargo-development-inputs (format-inputs cargo-development-inputs))
+         (description (beautify-description description))
          (pkg `(package
                    (name ,guix-name)
                    (version ,version)
@@ -212,7 +213,10 @@ (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inpu
                                                 cargo-development-inputs)))
                    (home-page ,home-page)
                    (synopsis ,(beautify-synopsis synopsis))
-                   (description ,(beautify-description description))
+                   (description ,(if (string-prefix? "This" description)
+                                   description
+                                   (string-append "This package provides "
+                                                  description)))
                    (license ,(match license
                                (() #f)
                                (#f #f)
diff --git a/tests/crate.scm b/tests/crate.scm
index ce2f08aade..8b5bbc1b03 100644
--- a/tests/crate.scm
+++ b/tests/crate.scm
@@ -503,7 +503,7 @@ (define have-guile-semver?
                          (("rust-leaf-alice" ('unquote 'rust-leaf-alice-0.7))))))
                       (home-page "http://example.com")
                       (synopsis "summary")
-                      (description "summary")
+                      (description "This package provides summary")
                       (license (list license:expat license:asl2.0))))
 
            (string=? test-source-hash hash))
@@ -592,7 +592,7 @@ (define have-guile-semver?
                  ('quasiquote (#:skip-build? #t)))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-leaf-alice-0.7
               (package
@@ -611,7 +611,7 @@ (define have-guile-semver?
                 (arguments ('quasiquote (#:skip-build? #t)))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-leaf-bob-3
               (package
@@ -630,7 +630,7 @@ (define have-guile-semver?
                 (arguments ('quasiquote (#:skip-build? #t)))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-intermediate-b-1
               (package
@@ -653,7 +653,7 @@ (define have-guile-semver?
                                  ('unquote rust-leaf-bob-3))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-intermediate-a-1
               (package
@@ -680,7 +680,7 @@ (define have-guile-semver?
                                  ('unquote rust-leaf-bob-3))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-root-1
               (package
@@ -711,7 +711,7 @@ (define have-guile-semver?
                                  ('unquote rust-intermediate-c-1))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0)))))
            #t)
           (x
@@ -740,7 +740,7 @@ (define have-guile-semver?
                                  ('unquote rust-leaf-alice-0.7))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-leaf-alice-0.7
               (package
@@ -758,7 +758,7 @@ (define have-guile-semver?
                 (build-system cargo-build-system)
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-leaf-bob-3
               (package
@@ -776,7 +776,7 @@ (define have-guile-semver?
                 (build-system cargo-build-system)
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-intermediate-b-1
               (package
@@ -798,7 +798,7 @@ (define have-guile-semver?
                                  ('unquote rust-leaf-bob-3))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-intermediate-a-1
               (package
@@ -824,7 +824,7 @@ (define have-guile-semver?
                                  ('unquote rust-leaf-bob-3))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-root-1
               (package
@@ -855,7 +855,7 @@ (define have-guile-semver?
                                  ('unquote rust-intermediate-c-1))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0)))))
            #t)
           (x
@@ -972,7 +972,7 @@ (define rust-leaf-bob-3.0.2-yanked
                              ('unquote 'rust-leaf-bob-4.0.0-yanked))))))
             (home-page "http://example.com")
             (synopsis "summary")
-            (description "summary")
+            (description "This package provides summary")
             (license (list license:expat license:asl2.0)))))
        #t)
       (x
@@ -1038,7 +1038,7 @@ (define rust-leaf-bob-3.0.2-yanked
                 (build-system cargo-build-system)
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-leaf-bob-3.0.2-yanked
               (package
@@ -1058,7 +1058,7 @@ (define rust-leaf-bob-3.0.2-yanked
                 (build-system cargo-build-system)
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-leaf-bob-3
               (package
@@ -1076,7 +1076,7 @@ (define rust-leaf-bob-3.0.2-yanked
                 (build-system cargo-build-system)
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0))))
             (define-public 'rust-bar-1
               (package
@@ -1103,7 +1103,7 @@ (define rust-leaf-bob-3.0.2-yanked
                                  ('unquote 'rust-leaf-bob-4.0.0-yanked))))))
                 (home-page "http://example.com")
                 (synopsis "summary")
-                (description "summary")
+                (description "This package provides summary")
                 (license (list license:expat license:asl2.0)))))
             #t)
           (x
-- 
2.41.0