我正在尝试使用cpanm (从perlbrew和perl版本5.30)安装Net::SSH::Perl。安装失败,并显示以下错误:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758019.381709/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.在this issue中描述了安装Crypt::Curve25519的问题。我下载了有问题的模块Crypt::Curve25519并给它打了补丁:
git clone git@github.com:ajgb/crypt-curve25519.git
wget https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
cd crypt-curve25519
git apply ../Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
perl Makefile.PL
make # No errors now
make test
make install但是,当我再次尝试安装Crypt::Curve25519时,它仍然尝试从CPAN安装损坏的模块:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758833.382749/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.如何让cpanm使用已安装的补丁(即跳过Crypt::Curve25519的安装,因为它已经安装)?
发布于 2020-04-25 04:22:17
有几件事需要检查:
还可以做一些其他的事情:
--notest功能)。@INC的前面,所以你的程序会首先找到它。这将有效地隐藏CPAN版本。发布于 2020-04-25 05:13:33
问题似乎是模块中缺少VERSION信息。通过添加一行
our $VERSION = 0.06; 到文件lib/Crypt/Curve25519.pm的顶部,然后重新安装,然后安装cpanm Net::SSH::Perl工作得很好(它接受打了补丁的安装,不会尝试下载损坏的版本)。
这是我用来lib/Crypt/Curve25519.pm的补丁
diff --git a/lib/Crypt/Curve25519.pm b/lib/Crypt/Curve25519.pm
index 686b706..d9c2b3d 100644
--- a/lib/Crypt/Curve25519.pm
+++ b/lib/Crypt/Curve25519.pm
@@ -1,4 +1,5 @@
package Crypt::Curve25519;
+our $VERSION = 0.06;
#ABSTRACT: Generate shared secret using elliptic-curve Diffie-Hellman function
use strict;https://stackoverflow.com/questions/61416648
复制相似问题