检查已安装的 perl 模块完整性的方法?
我安装了 MacPorts 和 CPAN,但我刚刚发现同时使用它们有点不好。 我最近通过 CPAN 安装了 perl 5.13.9,因为它有一些程序需要的更新模块。该 perl 安装在 /usr/local/bin 中。然后,MacPorts 将其 perl 更新到 5.12.3 (/opt/local/bin),并抱怨无法完成安装,因为一些 .3pm 文件已经存在(例如 cpan.3pm)。我强制安装并将有问题的文件转移到 MacPorts 的备份名称中。下次我使用 CPAN 时,它会再次执行配置步骤,所以我想知道是否需要将这些文件移回,和/或重新/卸载 perl5.12.3/5.13.9。 最好在终端中发出命令来查看/测试所有模块是否仍然正常工作。总的来说,我想知道如何安全地结合 CPAN 和 MacPorts。
帮助?
在 OS X 10.6.6 上。
编辑
见下文。
I have MacPorts and CPAN installed and I've only just found out that it's sort of bad to be using them both at the same time.
I recently installed perl 5.13.9 via CPAN as it had some updated modules that a program wanted. That perl is installed in /usr/local/bin. MacPorts then updated its perl to 5.12.3 (/opt/local/bin) and complained that it couldn't complete the installation because some .3pm files already existed (e.g. cpan.3pm). I forced the install and MacPorts mv'd the offending files to a backup name. The next time I used CPAN it went through the configuration steps again so I'm wondering whether I need to mv those files back, and/or re/uninstall perl5.12.3/5.13.9.
It would be nice to issue a command in Terminal to see/test if all the modules are still working correctly. And in general, I'm wondering how to combine CPAN and MacPorts safely.
Help?
On OS X 10.6.6.
edit
See below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我修好了!供任何其他 MacPorts/CPAN 用户参考:
我最终从 MacPorts 中强制卸载了 perl5 和 CPAN,并清除了 ~/.cpan。
sudo find /opt -name cpan
(或perl5
)应该只会产生几个端口文件。重新安装perl5。我还运行了
sudo port Upgrade outdated
。从那时起,只通过MacPorts而不是CPAN安装perl模块。例如,Digest::SHA 在 MacPort 上是 p5-digest-sha。
对于仅在 CPAN 上可用的内容,请按照简单的说明使用 cpan2port 这里。
I fixed it! For reference for any other MacPorts/CPAN users:
I ended up force-uninstalling perl5 and CPAN from MacPorts, and purging ~/.cpan. A
sudo find /opt -name cpan
(orperl5
) should result in nothing but a couple of portfiles.Re-install perl5. I also ran a
sudo port upgrade outdated
.From then on, only install perl modules via MacPorts instead of CPAN. For instance, Digest::SHA is p5-digest-sha on MacPorts.
For something only available on CPAN, use cpan2port by following the simple instructions here.
我个人喜欢集中管理系统,所以我会放弃额外的 Perl 并继续使用与系统更紧密集成的 Perl,这样更好维护。
如果您需要其他 Perl,则必须将它们分开保存。关于这一点,我在这里读到 brian d foy 很好的解释
如果你继续使用 Perl,但你需要从 CPAN 安装你自己的模型并避免与系统模型冲突,我建议 Chas。欧文斯的解决方案。
I personally like to keep systems centrally managed, so i'd get rid of additional Perl and continue with one which is more closely integrated with system, so it is better to maintain.
If you need other Perl, you have to keep them separatley. About that i read here brian d foy great explanation
If you stay with one Perl, but you need to install your own modeles from CPAN and avoid conflicting with system ones, i'd suggest Chas. Owens's solution.