分布.dist-id

hyt*_*thm 6 perl6 raku

编辑:更新,因为我是混淆的问题.dist-id.id;

我正在尝试卸载dist,但是当我将传递Distribution.uninstall它时,它似乎计算出了不同.dist-idDistribution并且没有被卸载。

我究竟做错了什么?

#!/usr/bin/env perl6

my $dist = $*REPO.candidates( 'Grid' ).head;
say $dist.WHAT, $dist.Str, $dist.dist-id;

say $*REPO.uninstall( $dist );
say $*REPO.uninstall( $dist ); # still there

# OUTPUT:
(LazyDistribution)Grid:ver<0.0.2>:auth<>:api<0>ADCD0F3EFF816F1212D5513F201B8143E2BDD6FF
["/home/hythm/.perl6/dist/157B7E1F2BB827C99A5EF3241D61853A85E57734".IO] # shouldn't this hash be the one above ? ?
["/home/hythm/.perl6/dist/157B7E1F2BB827C99A5EF3241D61853A85E57734".IO]
Run Code Online (Sandbox Code Playgroud)

uge*_*exe 5

我几乎可以保证它会被卸载。您认为uninstall返回某些路径意味着它不起作用的假设是错误的。请参阅:perl6 -e 'unlink("asdfaefawfk")',尝试require ::("XXX")uninstalls 之间添加a ,或尝试两次运行示例。

.dist-id不用于目录-通过查看以下源代码即可轻松验证-https uninstall: //github.com/rakudo/rakudo/blob/57f4a4c933e5f9c896051793722b33f254786695/src/core.c/CompUnit/Repository/Installation.pm6# L334

您还使用$*REPO不正确。您几乎总是需要grep $*REPO.repo-chain获取所需的特定存储库;不要以为第一个存储库始终是您认为的样子(因为当您执行eg时突然不是-I lib