简体   繁体   English

修复Perl CPAN模块 - 在哪里添加prerequsites以及要使用的版本?

[英]Fixing Perl CPAN modules - where to add prerequsites and what version to use?

When I find a problem with a CPAN module where there are missing prerequisites I want to help out by providing a patch via rt.cpan or a pull request via GitHub . 当我发现CPAN模块出现问题时,我希望通过rt.cpan提供补丁或通过GitHub提供拉取请求来帮助解决问题。

Say I find a problem with ACME::MadeUpName , which is missing a prerequisite Foo::Bard . 假设我发现ACME::MadeUpName存在问题,缺少先决条件Foo::Bard Would I just update the Makefile.PL adding ACME::MadeUpName to the PREREQ_PM section? 我是否只需更新Makefile.PLACME::MadeUpName添加到PREREQ_PM部分? Are there any other places I should update this? 还有其他地方我应该更新吗?

Also, how do I figure out which version of Foo::Bard to require? 另外,我如何确定需要哪个版本的Foo::Bard Do I just go with the latest CPAN release? 我是否只使用最新的CPAN版本?

If the release uses ExtUtils::MakeMaker or Module::Install, then Makefile.PL needs updating. 如果发行版使用ExtUtils :: MakeMaker或Module :: Install,则Makefile.PL需要更新。 If it uses Module::Build, then Build.PL instead. 如果它使用Module :: Build,那么使用Build.PL。 But in many cases, the Build.PL or Makefile.PL file won't be something the author manually maintains, but is built by some kind of release management tool, such as Dist::Zilla, in which case it's better to change the tool's config file rather than Build.PL or Makefile.PL (which would simply be overwritten anyway). 但在许多情况下,Build.PL或Makefile.PL文件不是作者手动维护的东西,而是由某种发布管理工具构建的,例如Dist :: Zilla,在这种情况下最好更改工具的配置文件而不是Build.PL或Makefile.PL(无论如何都会被覆盖)。

If you're unsure, it may be easier to simply submit a bug report without a patch for this kind of issue. 如果您不确定,可能更容易在没有针对此类问题的补丁的情况下提交错误报告。 It's probably a matter of 30 seconds work for the module author to fix - they're the ones who are going to be most familiar with their own build tools and release process. 模块作者修复可能需要30秒才能解决 - 他们是最熟悉自己的构建工具和发布过程的人。

In terms of versions, unless there's a particular feature of Foo::Bard used by ACME::MadeUpName that you know was added in a later version, declare a dependency on Foo::Bard 0 . 在版本方面,除非你知道在后来的版本中添加了ACME :: MadeUpName使用的Foo :: Bard的特定功能,否则声明对Foo::Bard 0的依赖。 Maybe later on it will turn out that 0 was overly optimistic, and a higher version number is required, but that bridge can be crossed when you come to it. 也许稍后会发现0过于乐观,并且需要更高的版本号,但是当你遇到它时,这个桥可以被交叉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM