summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Craven <david@craven.ch>2016-08-05 19:15:56 +0200
committerDavid Craven <david@craven.ch>2016-08-28 14:04:50 +0200
commita34b236c17f5f7a29c3ce05766071b57e8cdb271 (patch)
tree124cd95fb0aadda3fe469a339d86dc9f1f6da7a8
parent1ae27aac4cec9c16c878dbce85eef9e00c8e4240 (diff)
downloadguix-a34b236c17f5f7a29c3ce05766071b57e8cdb271.tar.gz
import: Importers return prefixed licenses.
* guix/import/utils.scm
(define-module): Import licenses with license: prefix.
(string->licenses): Use prefixed licenses.
(license->symbol): Return symbols with the prefix license:.
* guix/tests/pypi.scm (pypi->guix-package): Update test cases.
* guix/tests/gem.scm (gem->guix-package): Update test case.
-rw-r--r--guix/import/utils.scm26
-rw-r--r--tests/gem.scm2
-rw-r--r--tests/pypi.scm4
3 files changed, 16 insertions, 16 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 44e004b084..93cd0f0fa5 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -22,7 +22,7 @@
   #:use-module (srfi srfi-1)
   #:use-module (guix hash)
   #:use-module (guix base32)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix utils)
   #:use-module ((guix build download) #:prefix build:)
   #:export (factorize-uri
@@ -112,12 +112,12 @@ recursively apply the procedure to the sub-list."
 (define (string->license str)
   "Convert the string STR into a license object."
   (match str
-    ("GNU LGPL" lgpl2.0)
-    ("GPL" gpl3)
-    ((or "BSD" "BSD License") bsd-3)
-    ((or "MIT" "MIT license" "Expat license") expat)
-    ("Public domain" public-domain)
-    ((or "Apache License, Version 2.0" "Apache 2.0") asl2.0)
+    ("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)
     (_ #f)))
 
 (define (license->symbol license)
@@ -125,12 +125,12 @@ recursively apply the procedure to the sub-list."
 to in the (guix licenses) module, or #f if there is no such known license."
   ;; TODO: Traverse list public variables in (guix licenses) instead so we
   ;; don't have to maintain a list manualy.
-  (assoc-ref `((,lgpl2.0 . lgpl2.0)
-               (,gpl3 . gpl3)
-               (,bsd-3 . bsd-3)
-               (,expat . expat)
-               (,public-domain . public-domain)
-               (,asl2.0 . asl2.0))
+  (assoc-ref `((,license:lgpl2.0 . license:lgpl2.0)
+               (,license:gpl3 . license:gpl3)
+               (,license:bsd-3 . license:bsd-3)
+               (,license:expat . license:expat)
+               (,license:public-domain . license:public-domain)
+               (,license:asl2.0 . license:asl2.0))
              license))
 
 (define (snake-case str)
diff --git a/tests/gem.scm b/tests/gem.scm
index 0b37c70142..a46c2b1439 100644
--- a/tests/gem.scm
+++ b/tests/gem.scm
@@ -71,7 +71,7 @@
          ('synopsis "A cool gem")
          ('description "This package provides a cool gem")
          ('home-page "https://example.com")
-         ('license ('list 'expat 'asl2.0)))
+         ('license ('list 'license:expat 'license:asl2.0)))
        #t)
       (x
        (pk 'fail x #f)))))
diff --git a/tests/pypi.scm b/tests/pypi.scm
index 01d8a575ab..ab4e9c958b 100644
--- a/tests/pypi.scm
+++ b/tests/pypi.scm
@@ -130,7 +130,7 @@ baz > 13.37")
          ('home-page "http://example.com")
          ('synopsis "summary")
          ('description "summary")
-         ('license 'lgpl2.0))
+         ('license 'license:lgpl2.0))
        (string=? (bytevector->nix-base32-string
                   test-source-hash)
                  hash))
@@ -190,7 +190,7 @@ baz > 13.37")
          ('home-page "http://example.com")
          ('synopsis "summary")
          ('description "summary")
-         ('license 'lgpl2.0))
+         ('license 'license:lgpl2.0))
        (string=? (bytevector->nix-base32-string
                   test-source-hash)
                  hash))