import/print: Don't factorize URI if there's no version match.

* guix/import/print.scm (package->code): If FACTORIZE-URI returns just the
unmodified string use that as the URI.
This commit is contained in:
Ricardo Wurmus 2020-04-16 22:09:41 +02:00
parent 3fd4c4c839
commit 3c0422b9be
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 3 additions and 1 deletions

View File

@ -79,7 +79,9 @@ when evaluated."
(patches (origin-patches source)))
`(origin
(method ,(procedure-name method))
(uri (string-append ,@(factorize-uri uri version)))
(uri (string-append ,@(match (factorize-uri uri version)
((? string? uri) (list uri))
(factorized factorized))))
(sha256
(base32
,(format #f "~a" (bytevector->nix-base32-string sha256))))