2012-04-12 86 views
1

一些补丁作为紧我应该如何应用这种类型的补丁?

317c317 
<    global $wgScript, $wgUser, $wgParser, $wgTitle, $wgOut; 
--- 
>    global $wgScript, $wgUser, $wgParser, $wgTitle, $wgOut, $wgLocalTZoffset; 
370c370,371 
<        $output .= "<div class='news-bulletin-time'>" . date("M j, Y g:i a",strtotime($row->cl_timestamp)) . "</div>"; 
--- 
>        //Patched to display correct time in current time zone 
>        $output .= "<div class='news-bulletin-time'>" . date("M j, Y g:i a",strtotime($row->cl_timestamp) + ($wgLocalTZoffset * 60)) . "</div>"; 

我该如何申请,如补丁?

回答

2

只需使用patch工具和您的文件。

patch original.txt diffs.patch 

这适用,如果diffs.patch是没有额外的参数(你的例子看来是)由diff产生的补丁。例如,如果您有统一差异(diff -u),则必须通过传递适当的标志(-u用于统一差异)来通知patch