无法使用Cpan安装Archive::Zip

3

我正在尝试使用以下命令安装Archive::Zip:

cpan[3]> install Archive::Zip

然而它从未被安装。我不确定下一步该怎么做。这是我收到的日志:

Running install for module 'Archive::Zip'
Running make for P/PH/PHRED/Archive-Zip-1.58.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/Archive-Zip-1.58-1OzAcc
---- Unsatisfied dependencies detected during ----
----       PHRED/Archive-Zip-1.58.tar.gz      ----
    Test::MockModule [requires]
Running make test
  Delayed until after prerequisites
Running make install
  make test had returned bad status, won't install without force
  Delayed until after prerequisites
Running install for module 'Test::MockModule'
Running Build for G/GF/GFRANKS/Test-MockModule-0.11.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/Test-MockModule-0.11-_LrG4F
  '/usr/bin/perl Build.PL ' returned status 512, won't make
Running Build test
  Make had some problems, won't test
Running Build install
  Make had some problems, won't install
Running make for P/PH/PHRED/Archive-Zip-1.58.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/Archive-Zip-1.58-1OzAcc
Warning: Prerequisite 'Test::MockModule => 0' for 'PHRED/Archive-Zip-1.58.tar.gz' failed when processing 'GFRANKS/Test-MockModule-0.11.tar.gz' with 'writemakefile => NO '/usr/bin/perl Build.PL ' returned status 512'. Continuing, but chances to succeed are limited.
  Has already been made
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_compile.t ................ ok
t/02_main.t ................... ok
t/03_ex.t ..................... ok
t/04_readmember.t ............. ok
t/05_tree.t ................... ok
t/06_update.t ................. ok
t/07_filenames_of_0.t ......... ok
t/08_readmember_record_sep.t .. ok
t/09_output_record_sep.t ...... ok
t/10_chmod.t .................. ok
t/11_explorer.t ............... ok
t/12_bug_47223.t .............. skipped: Only required on Win32.
t/13_bug_46303.t .............. ok
t/14_leading_separator.t ...... ok
t/15_decrypt.t ................ ok
t/16_decrypt.t ................ ok
t/17_101092.t ................. ok
t/18_bug_92205.t .............. ok
t/19_bug_101240.t ............. ok
t/20_bug_github11.t ........... ok
t/21_zip64.t .................. ok
t/22_deflated_dir.t ........... ok
t/23_closed_handle.t .......... Can't locate Test/MockModule.pm in @INC (@INC contains: /root/.cpan/build/Archive-Zip-1.58-1OzAcc/blib/lib /root/.cpan/build/Archive-Zip-1.58-1OzAcc/blib/arch /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at t/23_closed_handle.t line 9.
BEGIN failed--compilation aborted at t/23_closed_handle.t line 9.
t/23_closed_handle.t .......... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
t/24_unicode_win32.t .......... ok

在安装完成后,以下是测试摘要:

Test Summary Report
-------------------
t/23_closed_handle.t        (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=24, Tests=302,  2 wallclock secs ( 0.07 usr  0.01 sys +  1.72 cusr  0.28 csys =  2.08 CPU)
Result: FAIL
Failed 1/24 test programs. 0/302 subtests failed.
make: *** [test_dynamic] Error 255
  PHRED/Archive-Zip-1.58.tar.gz
one dependency not OK (Test::MockModule); additionally test harness failed
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports PHRED/Archive-Zip-1.58.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 PHRED/Archive-Zip-1.58.tar.gz                : make_test NO one dependency not OK (Test::MockModule); additionally test harness failed

Here is my o conf of cpan.pm:

cpan[2]> o conf
$CPAN::Config options from /root/.cpan/CPAN/MyConfig.pm:
    commit             [Commit changes to disk]
    defaults           [Reload defaults from disk]
    help               [Short help about 'o conf' usage]
    init               [Interactive setting of all options]

    applypatch         []
    auto_commit        [0]
    build_cache        [100]
    build_dir          [/root/.cpan/build]
    build_dir_reuse    [0]
    build_requires_install_policy [yes]
    bzip2              [/usr/bin/bzip2]
    cache_metadata     [1]
    check_sigs         [0]
    colorize_debug     undef
    colorize_output    undef
    colorize_print     undef
    colorize_warn      undef
    commandnumber_in_prompt [1]
    commands_quote     undef
    connect_to_internet_ok [1]
    cpan_home          [/root/.cpan]
    curl               undef
    dontload_hash      undef
    dontload_list      undef
    ftp                undef
    ftp_passive        [1]
    ftp_proxy          []
    ftpstats_period    undef
    ftpstats_size      undef
    getcwd             [cwd]
    gpg                [/usr/bin/gpg]
    gzip               [/usr/bin/gzip]
    halt_on_failure    [0]
    histfile           [/root/.cpan/histfile]
    histsize           [100]
    http_proxy         []
    inactivity_timeout [0]
    index_expire       [1]
    inhibit_startup_message [0]
    keep_source_where  [/root/.cpan/sources]
    load_module_verbosity [none]
    lynx               undef
    make               [/usr/bin/make]
    make_arg           []
    make_install_arg   []
    make_install_make_command [sudo /usr/bin/make]
    makepl_arg         []
    mbuild_arg         []
    mbuild_install_arg []
    mbuild_install_build_command [sudo ./Build]
    mbuildpl_arg       []
    ncftp              undef
    ncftpget           undef
    no_proxy           []
    pager              [/usr/bin/less]
    password           undef
    patch              []
    patches_dir        undef
    perl5lib_verbosity [none]
    prefer_external_tar [1]
    prefer_installer   [MB]
    prefs_dir          [/root/.cpan/prefs]
    prerequisites_policy [follow]
    proxy_pass         undef
    proxy_user         undef
    randomize_urllist  undef
    scan_cache         [atstart]
    shell              [/bin/bash]
    show_unparsable_versions [0]
    show_upload_date   [0]
    show_zero_versions [0]
    tar                [/usr/bin/tar]
    tar_verbosity      [none]
    term_is_latin      [1]
    term_ornaments     [1]
    test_report        [0]
    trust_test_report_history [0]
    unzip              [/usr/bin/unzip]
    urllist
        0 [http://cpan.perl-hackers.net/]
        1 [http://download.xs4all.nl/CPAN/]
        2 [http://cpan.mirrors.uk2.net/]
    use_sqlite         [0]
    username           undef
    version_timeout    [15]
    wait_list          undef
    wget               [/usr/bin/wget]
    yaml_load_code     [0]
    yaml_module        [YAML]

我正在使用CentOS操作系统。

你能提供更多关于这个特定系统的信息吗?在你的情况下,错误提示说缺少Test::MockModule。你可以尝试预先安装它,但也许它需要一些外部依赖。另一方面,在Ubuntu中我已经成功使用cpanm安装了它,所以我们需要更多信息来重现这个问题。 - jjmerelo
@jjmerelo 我其实已经说明我正在使用CentOS。不过还是会尝试你的解决方案。 - prgrm
尝试这样做:look Test::MockModule,然后运行 perl Build.PL - rustyx
尝试使用yum list MockModule查看其是否可用(似乎不可用),然后按照上述方式单独安装它,检查其中的问题。您使用的是哪个版本的CentOS?无论如何,该模块似乎没有针对CentOS进行测试http://www.cpantesters.org/distro/T/Test-MockModule.html#Test-MockModule-0.11,因此您的结果可能会有所不同。 - jjmerelo
@prgrm 试试这个。cd ./.cpan/build/Test-MockModule-0.11-_LrG4F/; perl Build.PL - rustyx
显示剩余5条评论
1个回答

15

试试这个:

cpan -f Archive::Zip

我相信几周前遇到过这个问题,那只是测试套件出了问题,模块本身工作正常。可能因人而异。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接