summaryrefslogtreecommitdiff
path: root/guix/scripts/import.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-03-21 00:16:22 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-04-09 23:02:37 -0400
commit83f8b6d32c76c56e4bb58eeb5af1259028d7ee72 (patch)
tree64cd50f8c435d240bdbc704ce14c361dc6674293 /guix/scripts/import.scm
parenta8b927a562aad7e5f77d0e4db2d9cee3434446d2 (diff)
downloadguix-patches-83f8b6d32c76c56e4bb58eeb5af1259028d7ee72.tar
guix-patches-83f8b6d32c76c56e4bb58eeb5af1259028d7ee72.tar.gz
import: go: Append version to symbol name in the pinned version mode.
This allows importing packages with complicated version specific dependency chains without the package symbol names colliding. * doc/guix.texi (Invoking guix import): Document the --pin-versions option. Mention that a specific version can be imported. Remove the experimental warning. * guix/import/go.scm (go-module->guix-package-name)[version]: Add optional argument. Rewrite the character translation in terms of string-map. (go-module->guix-package): Conditionally use dependencies whose symbol include their version, based no the value of the PIN-VERSIONS? argument. * guix/import/utils.scm (package->definition): Add a new case where the full version string is appended to the package symbol. * guix/scripts/import.scm (guix-import): Correctly print forms starting with '(define-public [...]'. * guix/scripts/import/go.scm (guix-import-go): Conditionally include the version in the package symbols defined.
Diffstat (limited to 'guix/scripts/import.scm')
-rw-r--r--guix/scripts/import.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index 1d2b45d942..98554ef79b 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -119,7 +119,8 @@ Run IMPORTER with ARGS.\n"))
(current-output-port))))))
(match (apply (resolve-importer importer) args)
((and expr (or ('package _ ...)
- ('let _ ...)))
+ ('let _ ...)
+ ('define-public _ ...)))
(print expr))
((? list? expressions)
(for-each (lambda (expr)