diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-03-21 00:16:22 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-04-09 23:02:37 -0400 |
commit | 83f8b6d32c76c56e4bb58eeb5af1259028d7ee72 (patch) | |
tree | 64cd50f8c435d240bdbc704ce14c361dc6674293 /guix/import/utils.scm | |
parent | a8b927a562aad7e5f77d0e4db2d9cee3434446d2 (diff) | |
download | guix-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/import/utils.scm')
-rw-r--r-- | guix/import/utils.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm index adf90f84d7..d817318a91 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -274,8 +274,9 @@ snippet generated is for regular inputs." (maybe-inputs package-names output #:type 'propagated)) (define* (package->definition guix-package #:optional append-version?/string) - "If APPEND-VERSION?/STRING is #t, append the package's major+minor -version. If APPEND-VERSION?/string is a string, append this string." + "If APPEND-VERSION?/STRING is #t, append the package's major+minor version. +If it is the symbol 'full, append the package's complete version. If +APPEND-VERSION?/string is a string, append this string." (match guix-package ((or ('package ('name name) ('version version) . rest) @@ -287,6 +288,8 @@ version. If APPEND-VERSION?/string is a string, append this string." (string-append name "-" append-version?/string)) ((eq? append-version?/string #t) (string-append name "-" (version-major+minor version))) + ((eq? 'full append-version?/string) + (string-append name "-" version)) (else name))) ,guix-package)))) |