当使用rakubrew升级rakudo版本时,很容易更改版本,但我想知道是否可以将raku模块从旧版本导入到新版本。doign zef自动安装:
要更新,请执行以下操作:
rakubrew build 2020.10但随后:
❯ raku
Welcome to ™ v2020.10.
Implementing the ™ programming language v6.d.
Built on MoarVM version 2020.10.
You may want to `zef install Readline` or `zef install Linenoise` or use rlwrap for a line editor
To exit type 'exit' or '^D'所以我需要安装我当前使用的所有模块:
rakubrew build-zef zef install Sparrow6 zef install Linenoise
因此,存在任何文件.zef或.rakubrew或检查以自动维护此模块的任何内容
发布于 2020-10-29 22:29:42
您可以使用zef list --installed获取已安装模块的列表。注您可能希望忽略share/perl6代码库,因为其中包含的CORE模块特定于每个版本的rakudo。
请参阅:https://github.com/ugexe/zef#list-from
列表*@来自
列出已知的可用发行版
$ zef --安装列表
通过/home/nickl/.rakubrew/moar-master/install/share/perl6/site找到===>
CSV::Parser:ver<0.1.2>:auth
Zef:auth
通过/home/nickl/.rakubrew/moar-master/install/share/perl6找到===>
CORE:ver<6.c>:auth
或者,您可以使用以下一行程序来获取列表:
$ raku -e 'say $*REPO.repo-chain.grep(CompUnit::Repository::Installation).map(*.installed.Slip).grep(*.defined).map({ CompUnit::Repository::Distribution.new($_).Str }).join(" ")'
Text::Table::Simple:ver<0.0.7>:auth<github:ugexe>:api<> CSV::Parser:ver<0.1.2>:auth<github:tony-o>:api<> CORE:ver<6.d>:auth<perl>:api<>
# $*REPO.repo-chain.grep(CompUnit::Repository::Installation) # Get only repos for installed raku modules
# .map(*.installed.Slip) # Get a list of installed modules for this repo, and Slip it into the outer singular results list
# .grep(*.defined) # Some repos will have had no modules, so remove these undefined entries
# .map({ CompUnit::Repository::Distribution.new($_).Str }) # Use CompUnit::Repository::Distribution to get at the normalized identifier
# .join(" ") # Join the results together一旦您选择了一种创建需要安装的列表的方法,您就可以将该列表传递给zef (尽管您的shell可能会要求您引用在命令行上显式传递的名称)
发布于 2020-11-03 03:38:59
rakubrew在不同的目录$HOME/.rakubrew/versions/moar-*中安装不同的Raku版本
因此,每个Raku版本都有自己的独立Installation存储库( site, vendor, ... )。
我想,因为默认情况下,zef会将发行版安装到site存储库中。因此,这些模块在多个版本下不可用。
但是,因为Raku使用home Installation repo (#inst/home/user-name/.raku),并且它存在于repo-chain中,所以您可以将您希望在所有版本上可用的模块安装到home repo (~/.raku)中。(这些模块将在新的Raku版本中第一次useed时预编译)。
请注意,我没有在zef上测试过,但我使用的是Pakku,它默认安装在home代码库中,并且我安装到home中的模块在我的Linux机器上的所有rakubrew Raku版本中都可用。
https://stackoverflow.com/questions/64586605
复制相似问题