2

我正在尝试安装一个模块来操作 HHMMSS 格式的时间——只是为了找到基本的时差等。Time::ParseDate 看起来像一个完美的候选人,但我在安装它时遇到了一些麻烦。

我使用的是为 MSWin32-x64-multi-thread 构建的 perl 5,版本 16,subversion 3 (v5.16.3)。

命令:

cpan Time::ParseDate 

返回

Set up gcc environment - 4.4.7 20111023 (prerelease) [svn/rev.180339 - mingw-w64/oz]
Checking if your kit is complete...
Looks good
Writing Makefile for Time::ParseDate
Writing MYMETA.yml and MYMETA.json
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Cannot copy 'lib/Time/JulianDay.pm' to 'blib\lib\Time\JulianDay.pm': No such     file or directory
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1.
dmake.exe:  Error code 130, while making 'pm_to_blib'
  MUIR/modules/Time-ParseDate-2013.0920.tar.gz
  C:\Dwimperl\c\bin\dmake.exe -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

有人可以准确解释出了什么问题吗?看起来我缺少 lib/Time/JulianDay.pm,但为什么呢?我是否必须更新我的 Perl 版本或我的 Cpan 版本?

我删除了 Autorun 注册表项,然后重试安装。我有:

CPAN: Term::ANSIColor loaded ok (v4.02)
CPAN: Storable loaded ok (v2.34)
Reading 'C:\Perl64\cpan\Metadata'
  Database was generated on Tue, 05 Nov 2013 20:53:02 GMT
 Running install for module 'Time::ParseDate'
 Running make for M/MU/MUIR/modules/Time-ParseDate-2013.0920.tar.gz
 CPAN: Digest::SHA loaded ok (v5.84)
   CPAN: Compress::Zlib loaded ok (v2.06)
 Checksum for C:\Perl64\cpan\sources\authors\id\M\MU\MUIR\modules\Time-ParseDate-2013.0920.tar.gz ok
 CPAN: Archive::Tar loaded ok (v1.90)
 Time-ParseDate-2013.0920/
 etc...
Time-ParseDate-2013.0920/t/datetime.t
 CPAN: File::Temp loaded ok (v0.22)
 CPAN: Parse::CPAN::Meta loaded ok (v1.4404)
CPAN: CPAN::Meta loaded ok (v2.120921)
 CPAN: Module::CoreList loaded ok (v2.80)

 CPAN.pm: Building M/MU/MUIR/modules/Time-ParseDate-2013.0920.tar.gz

Set up gcc environment - 4.4.7 20111023 (prerelease) [svn/rev.180339 - mingw-w64/oz]
Checking if your kit is complete...
Looks good
Writing Makefile for Time::ParseDate
Writing MYMETA.yml and MYMETA.json
cp lib/Time/JulianDay.pm blib\lib\Time\JulianDay.pm
cp lib/Time/CTime.pm blib\lib\Time\CTime.pm
cp lib/Time/ParseDate.pm blib\lib\Time\ParseDate.pm
cp lib/Time/DaysInMonth.pm blib\lib\Time\DaysInMonth.pm
cp lib/Time/Timezone.pm blib\lib\Time\Timezone.pm
  MUIR/modules/Time-ParseDate-2013.0920.tar.gz
  C:\Dwimperl\c\bin\dmake.exe -- OK
CPAN: YAML::XS loaded ok (v0.39)
Running make test
C:\Perl64\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib',    'blib\arch')" t/*
t/datetime.t .. ok
t/metdate.t ... skipped: It seems localtime() does not honor $ENV{TZ} when set in the  test script.
t/order1.t .... 1/?
#   Failed test 'Europe/Moscow, DST permanent 2009'
#   at t/order1.t line 34.
#          got: '1257030000'
#     expected: '1257022800'

#   Failed test 'Europe/Moscow, DST permanent 2013'
#   at t/order1.t line 35.
#          got: '1369868400'
#     expected: '1369857600'
# Looks like you failed 2 tests of 5.
t/order1.t .... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests
t/order2.t .... 1/?
#   Failed test 'Europe/Moscow, DST permanent 2013'
#   at t/order2.t line 34.
#          got: '1369868400'
#     expected: '1369857600'

#   Failed test 'Europe/Moscow, DST permanent 2009'
#   at t/order2.t line 35.
#          got: '1257030000'
#     expected: '1257022800'
# Looks like you failed 2 tests of 5.
t/order2.t .... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests

Test Summary Report
-------------------
t/order1.t  (Wstat: 512 Tests: 5 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2
t/order2.t  (Wstat: 512 Tests: 5 Failed: 2)
  Failed tests:  3-4
  Non-zero exit status: 2
Files=4, Tests=331,  1 wallclock secs ( 0.09 usr +  0.06 sys =  0.16 CPU)
Result: FAIL
Failed 2/4 test programs. 4/331 subtests failed.
dmake.exe:  Error code 130, while making 'test_dynamic'
  MUIR/modules/Time-ParseDate-2013.0920.tar.gz
  C:\Dwimperl\c\bin\dmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MUIR/modules/Time-ParseDate-2013.0920.tar.gz
Running make install
  make test had returned bad status, won't install without force
4

2 回答 2

3

Time-ParseDate 的测试套件根本无法在 Windows 系统上通过。请参阅http://matrix.cpantesters.org/?dist=Time-ParseDatehttp://matrix.cpantesters.org/?dist=Time-ParseDate;maxver=1。我自己用 Strawberry Perl 和 ActivePerl 都试过了,两个 perls 的测试套件都失败了(测试需要摆弄 TZ 环境变量,但这在 Windows 系统上的工作方式与在 Unix/Linux 系统上的工作方式不同,另请参阅错误报告https://rt.cpan.org/Ticket/Display.html?id=90367)。

您可以尝试通过强制安装或跳过测试来安装未经测试的模块。在 CPAN 外壳中:

force install Date::JulianDay

或者

notest install Date::JulianDay
于 2013-11-14T23:16:40.503 回答
1

似乎您在“HKCU\Software\Microsoft\Command Processor”中的自动运行设置在安装过程中将子进程导航到远离当前路径的位置,从而导致在错误的位置创建文件。

于 2013-11-13T22:33:37.703 回答