【问题标题】:How do I convince cpanminus to install modules in lib/ instead of lib/perl5?如何说服 cpanminus 在 lib/ 而不是 lib/perl5 中安装模块?
【发布时间】:2019-01-24 21:07:27
【问题描述】:

我正在将cpanfile 中列出的一堆模块安装到一个独立的目录中:

 cpanm -L bundle --quiet --notest --self-contained --with-recommends --installdeps .

之后,所有模块都在bundle/lib/perl5。这几乎正​​是我想要的。是否有提供cpanm 的咒语——或要设置的环境变量——让cpanm 告诉安装程序将文件放入bundle/lib,而不是?我认为我需要做一些事情来说服 ExtUtils::MakeMaker 和 Module::Build 将不同的值附加到 install_base,但我无法弄清楚如何。

【问题讨论】:

  • 听起来您已将local::lib 安装到bundle/lib/perl5
  • 我正在传递-L bundle,它构建的东西好像 local::lib 设置为bundle。我认为它会在bundle/lib/perl5 中安装模块,因为$Config{installstyle} 设置为lib/perl5 而不是lib——不管local::lib 设置为使用什么都是如此。

标签: perl configuration installation cpan cpanm


【解决方案1】:

通过Module::Build source,它looks like it's not possible 安装没有目录的perl5 部分的模块- 至少在使用install_base 时不会(cpanm 的--self-contained 暗示)。从评论来看,似乎在使用install_base 时始终安装在lib/perl5 中的决定是一致的,以使事情尽可能可预测。看起来也像MakeMaker has it hard-coded

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-03
    • 1970-01-01
    • 2014-10-26
    • 2014-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多