請問如何patch? - Linux

By David
at 2017-03-09T21:07
at 2017-03-09T21:07
Table of Contents
請教各位先進
我想在已安裝好的cactiez 0.7上安裝rancid
目前下載之後解壓縮 ./configure
會卡在下面停住
checking Socket.pm version... Socket version 2.006 required--this is only
version 1.82 at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
configure: error: Socket.pm is older than 2.006; upgrade from
http://metacpan.org/pod/Socket
我google到以下網頁似乎可以用patch處理
https://lists.gt.net/rancid/users/8481
patch的內容如下
----------------------------------------
patch -p0 << "EOF"
--- configure
+++ configure
@@ -5316,15 +5316,6 @@
PERLV=`basename $PERLV_PATH`
-# check Socket.pm version
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Socket.pm version" >&5
-$as_echo_n "checking Socket.pm version... " >&6; }
-$PERLV_PATH -e 'use 2.006 Socket qw(inet_pton);' 2>&1 >/dev/null
-if test $? -ne 0 ; then
- as_fn_error $? "Socket.pm is older than 2.006; upgrade from http://metacpan.org/pod/Socket" "$LINENO" 5
- exit 1
-fi
-
# Extract the first word of "expect", so it can be a program name with args.
set dummy expect; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
--- lib/rancid.pm.in
+++ lib/rancid.pm.in
@@ -48,7 +48,7 @@
use 5.010;
use strict 'vars';
use warnings;
-use 2.006 Socket qw(AF_INET AF_INET6 inet_pton);
+use Socket qw(AF_INET AF_INET6);
require(Exporter);
our @ISA = qw(Exporter);
@@ -351,6 +351,11 @@
@sorted_lines;
}
+sub inet_pton {
+ my($family, $addr) = @_;
+ return inet_pton($family, $addr);
+}
+
# ipaddrval(IPaddr) converts and IPv4/v6 address to a string for comparison.
# Some may ask why not use Net::IP; performance. We tried and it was horribly
# slow.
EOF
----------------------------------------
我之前使用patch都是用檔案
上面這種方式我沒用過
想請問是照貼就可以嗎 另外貼完後要怎麼接到剛剛中斷的./configure ?
或是有其它方式可以處理也請不吝告知,謝謝!!
--
Tags:
Linux
All Comments

By Mia
at 2017-03-10T08:48
at 2017-03-10T08:48

By Delia
at 2017-03-11T19:09
at 2017-03-11T19:09

By Jacky
at 2017-03-14T07:29
at 2017-03-14T07:29

By Eden
at 2017-03-17T07:18
at 2017-03-17T07:18
Related Posts
關於檔案目錄權限

By Isabella
at 2017-03-07T21:10
at 2017-03-07T21:10
vim 在 screen 下 plugin 與設定 失效

By Tracy
at 2017-03-06T16:55
at 2017-03-06T16:55
Using linux on winxp

By James
at 2017-03-06T11:24
at 2017-03-06T11:24
用TSOCKS上網沒作用?

By Enid
at 2017-03-05T16:58
at 2017-03-05T16:58
關於nginx proxy_pass 轉向問題

By Hedwig
at 2017-03-05T11:38
at 2017-03-05T11:38