請問如何patch? - Linux

David avatar
By David
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

Mia avatar
By Mia
at 2017-03-10T08:48
<< here document。就是後面直到EOF為止當檔案輸入。
Delia avatar
By Delia
at 2017-03-11T19:09
與你將內容另存檔案再輸入patch等效。執行後就是執行一次
Jacky avatar
By Jacky
at 2017-03-14T07:29
patch,之後再正常執行configure就好。
Eden avatar
By Eden
at 2017-03-17T07:18
啊!所以簡單說,貼上終端機執行就好。

關於檔案目錄權限

Isabella avatar
By Isabella
at 2017-03-07T21:10
大家好 想請教關於chmod 權限問題, 如果目錄下有三個Group,分別為 A B C, 一般都會設755,方便互相讀取資料, 那麼,有可能改變權限,只讓A跟B互相看的到, 但是C的成員,看不到A跟B內的內容嗎? 像是750的狀態,謝謝。 ----- Sent from JPTT on my LGE N ...

vim 在 screen 下 plugin 與設定 失效

Tracy avatar
By Tracy
at 2017-03-06T16:55
各位大大好 我在 /home目錄下建立一個 python 開發環境的.vimrc 一切都運作正常 單後來為了多視窗使用就安裝了 screen 可是卻發現 在 screen 的 windows 下 .vimrc 的設定都跑掉 變成初始的 vim 設定 但是不在 screen 下就可以正常運作 不知道有 ...

Using linux on winxp

James avatar
By James
at 2017-03-06T11:24
小弟嘗試在windows 作業系統下安裝 ubuntu 4.1 linux 目前跑起來不會lag 但是無法 上網 請問如何設定?畫面如下http://imgur.com/a/EeamH - ...

用TSOCKS上網沒作用?

Enid avatar
By Enid
at 2017-03-05T16:58
我下指令TSOCKS GOOGLE-CHROME-STABLE 連YOUTUBE都沒辦法連 請問該怎麼設定TSOCKS 看了GOOGLE過看不太懂 - ...

關於nginx proxy_pass 轉向問題

Hedwig avatar
By Hedwig
at 2017-03-05T11:38
卡好久 orz 我想請問的是我有一個需代轉的website proxy_pass原先是指向 http://{ip address}:8080 我有辦法改為以hostname嗎? 像是 http://{hostname}:8080 舉例來說是指向 http://another_pc:8080 但目前 ...