gpt4 book ai didi

raku - 使用 rakubrew 在其他 rakudo 版本中安装模块

转载 作者:行者123 更新时间:2023-12-03 17:06:07 31 4
gpt4 key购买 nike

使用 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 安装 Sparrow6
zef 安装 Linenoise
因此存在任何文件 .zef 或 .rakubrew 或检查以自动维护此模块的东西

最佳答案

您可以使用 zef list --installed 获取已安装模块的列表.请注意,您可能想忽略 share/perl6 repo ,作为 CORE其中包含的模块特定于每个版本的 rakudo。
见:https://github.com/ugexe/zef#list-from

list [*@from]

List known available distributions

$ zef --installed list

===> Found via /home/nickl/.rakubrew/moar-master/install/share/perl6/site

CSV::Parser:ver<0.1.2>:auth<github:tony-o>

Zef:auth<github:ugexe>

===> Found via /home/nickl/.rakubrew/moar-master/install/share/perl6

CORE:ver<6.c>:auth<perl>


或者,您可以使用以下单行来获取列表:
$ 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 可能要求您在命令行中明确引用传入的名称)

关于raku - 使用 rakubrew 在其他 rakudo 版本中安装模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64586605/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com