[問題] 請問如何patch?

看板Linux作者 (愛看天空的大叔)時間8年前 (2017/03/09 21:07), 編輯推噓1(103)
留言4則, 1人參與, 最新討論串1/1
請教各位先進 我想在已安裝好的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 ? 或是有其它方式可以處理也請不吝告知,謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.130.189.241 ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1489064841.A.2A2.html

03/10 05:42, , 1F
<< here document。就是後面直到EOF為止當檔案輸入。
03/10 05:42, 1F

03/10 05:43, , 2F
與你將內容另存檔案再輸入patch等效。執行後就是執行一次
03/10 05:43, 2F

03/10 05:44, , 3F
patch,之後再正常執行configure就好。
03/10 05:44, 3F

03/10 05:45, , 4F
啊!所以簡單說,貼上終端機執行就好。
03/10 05:45, 4F
文章代碼(AID): #1OmLE9AY (Linux)
文章代碼(AID): #1OmLE9AY (Linux)