【问题标题】:How to cpan install from a local source [Linux::Inotify2]如何从本地源进行 cpan 安装 [Linux::Inotify2]
【发布时间】:2019-11-21 22:04:08
【问题描述】:

尝试在 Fedora Core 6 x86 机器上安装 Linux::Inotify 失败。

看起来低于 2.6.36 的内核不支持 IN_EXCL_UNLINK。这会导致安装问题。所以我修改了源代码并尝试安装。但是 cpan 再次将其替换为在线 repo。

Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ..... Undefined subroutine &Linux::Inotify2::IN_EXCL_UNLINK called at /root/.cpan/build/Linux-Inotify2-2.1/blib/lib/Linux/Inotify2.pm line 431.
Compilation failed in require at t/00_load.t line 3.
BEGIN failed--compilation aborted at t/00_load.t line 3.
t/00_load.t ..... Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests
t/01_inotify.t .. Undefined subroutine &Linux::Inotify2::IN_EXCL_UNLINK called at /root/.cpan/build/Linux-Inotify2-2.1/blib/lib/Linux/Inotify2.pm line 431.
Compilation failed in require at t/01_inotify.t line 2.
BEGIN failed--compilation aborted at t/01_inotify.t line 2.
# Looks like your test exited with 255 before it could output anything.
t/01_inotify.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 5/5 subtests

Test Summary Report
-------------------
t/00_load.t   (Wstat: 65280 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 255
t/01_inotify.t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 5 tests but ran 0.
Files=2, Tests=1,  0 wallclock secs ( 0.01 usr  0.05 sys +  0.05 cusr  0.08 csys =  0.19 CPU)
Result: FAIL
Failed 2/2 test programs. 1/1 subtests failed.
make: *** [test_dynamic] Error 255
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force

有没有办法修复这个问题或使用 CPAN 本地源安装?

注意:编辑源代码后使用源代码进行安装可以正常工作。

【问题讨论】:

  • 是的,例如,您可以在运行perl Makefile.PL 之前创建一个应用于Inotify2.pm 的本地补丁。也请notify the author模块的notify the author关于这个问题,也许他们会在未来提供修复
  • "使用源代码进行安装工作正常" - 那么它已经安装了。
  • Fedora Core 6 已于 2007 年报废!它已经十多年没有安全更新了!尽快升级操作系统!

标签: perl cpan inotify cpanm


【解决方案1】:
wget https://cpan.metacpan.org/authors/id/M/ML/MLEHMANN/Linux-Inotify2-2.1.tar.gz
tar xzf Linux-Inotify2-2.1.tar.gz
cd Linux-Inotify2-2.1
...apply change...
perl Makefile.PL
make test
make install

听起来你已经这样做了,所以你已经安装了它。 cpan 不会替换它(如果它看到已安装的版本(它会,除非你使用了错误的 perl,或者除非你使用 env var PERL_MB_OPT 告诉 ExtUtils::MakeMaker 将模块安装在非标准位置,并没有通过 env var PERL5LIB) 告诉 CPAN。

【讨论】:

  • cpanm --look Linux::Inotify2 也可以作为这里的第一步。
【解决方案2】:

使用 CPAN 本地源安装?

cpanm 支持从本地 tarball 安装(包含已修补的源),请参阅 synopsis

cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz   # install from a local file

【讨论】:

    猜你喜欢
    • 2020-02-12
    • 2010-11-02
    • 1970-01-01
    • 1970-01-01
    • 2010-10-07
    • 2015-07-01
    • 2016-03-22
    • 1970-01-01
    • 2013-09-24
    相关资源
    最近更新 更多