2012-04-12 47 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