[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#42338] [PATCH v3 6/7] guix: import: composer: More robust string->l
From: |
Nicolas Graves |
Subject: |
[bug#42338] [PATCH v3 6/7] guix: import: composer: More robust string->license. |
Date: |
Tue, 26 Sep 2023 12:31:43 +0200 |
* guix/import/composer.scm (string->license): Use spdx-string->license. Fall
back to unknown-license!.
---
guix/import/composer.scm | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/guix/import/composer.scm b/guix/import/composer.scm
index 3acbbecf82..2ce7206ef9 100644
--- a/guix/import/composer.scm
+++ b/guix/import/composer.scm
@@ -194,10 +194,8 @@ (define (make-php-sexp composer-package)
(synopsis "")
(description ,(composer-package-description composer-package))
(home-page ,(composer-package-homepage composer-package))
- (license ,(match (composer-package-license composer-package)
- (() #f)
- ((license) license)
- (_ license)))))))))
+ (license ,(or (composer-package-license composer-package)
+ 'unknown-license!))))))))
(define composer->guix-package
(memoize
@@ -234,14 +232,15 @@ (define (guix-package->composer-name package)
(define (string->license str)
"Convert the string STR into a license object."
- (match str
- ("GNU LGPL" 'license:lgpl2.0)
- ("GPL" 'license:gpl3)
- ((or "BSD" "BSD License" "BSD-3-Clause") 'license:bsd-3)
- ((or "MIT" "MIT license" "Expat license") 'license:expat)
- ("Public domain" 'license:public-domain)
- ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0)
- (_ #f)))
+ (or (spdx-string->license str)
+ (match str
+ ("GNU LGPL" 'license:lgpl2.0)
+ ("GPL" 'license:gpl3)
+ ((or "BSD" "BSD License") 'license:bsd-3)
+ ((or "MIT" "MIT license" "Expat license") 'license:expat)
+ ("Public domain" 'license:public-domain)
+ ((or "Apache License, Version 2.0" "Apache 2.0") 'license:asl2.0)
+ (_ 'unknown-license!))))
(define (php-package? package)
"Return true if PACKAGE is a PHP package from Packagist."
--
2.41.0
- [bug#42338] [PATCH v3 1/7] guix: import: Add composer importer., Nicolas Graves, 2023/09/26
- [bug#42338] [PATCH v3 2/7] gnu: Add composer-classloader., Nicolas Graves, 2023/09/26
- [bug#42338] [PATCH v3 3/7] guix: Add composer-build-system., Nicolas Graves, 2023/09/26
- [bug#42338] [PATCH v3 6/7] guix: import: composer: More robust string->license.,
Nicolas Graves <=
- [bug#42338] [PATCH v3 7/7] guix: import: composer: Modern inputs formatting., Nicolas Graves, 2023/09/26
- [bug#42338] [PATCH v3 5/7] guix: import: composer: Fix json->require., Nicolas Graves, 2023/09/26
- [bug#42338] [PATCH v3 4/7] guix: import: composer: Use memoization., Nicolas Graves, 2023/09/26
- [bug#42338] [PATCH v3 1/7] guix: import: Add composer importer., Nicolas Graves, 2023/09/26