升級 tar 修正出現 pax_global_header 的訊息

由於 kernel 的程式碼自 2.6.12 版起,在提供的 tar-archives 中多加了 git commit ID 的 extended header ,如果你的 tar 版本較舊,就會出現一個警告訊息,進而產生一個 pax_global_header 的檔案。

程式碼:
tar xjf linux-2.6.19.7.tar.bz2
tar: pax_global_header: Unknown file type 'g', extracted as normal file

tar --version
tar (GNU tar) 1.13.25
Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.


查了一下,雖然這是一個無關痛癢的警告,不過出現實還是怪怪的,如果可以將 tar 的版本升級至 1.14 以後,就能夠避掉這樣的警告訊息。因為習慣在 RPM 的系統下處理作業,而該主機的環境卻仍停留在 Fedora Core 2 ,就連 The Fedora Legacy Project 都不再維護,所以興起了自己編譯 tar RPM 的念頭。

曾經有將新版的 sendmail 由 Tar Ball 轉成 RPM 的經驗,所以編譯環境已經存在,不再贅述,這次依然如法泡製一番!

1.安裝 tar 的 SOURCE RPM:

程式碼:
rpm -ivh tar-1.13.25-14.1.legacy.src.rpm


2.下載新版 tar 原始碼,置於 /usr/src/redhat/SOURCES/ 目錄中:

程式碼:
wget http://ftp.gnu.org/gnu/tar/tar-1.20.tar.bz2


3.編輯 SPEC 檔,保留 man page 的 patch,否則無法編譯成功:

程式碼:
diff -urN tar-vic.spec tar.spec
--- tar-vic.spec 2008-06-08 14:12:06.936689000 +0800
+++ tar.spec 2006-03-09 08:25:32.000000000 +0800
@@ -1,7 +1,7 @@
Summary: A GNU file archiving program.
Name: tar
-Version: 1.20
-Release: vic
+Version: 1.13.25
+Release: 14.1.legacy
License: GPL
Group: Applications/Archiving
Source: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.bz2
@@ -32,13 +32,13 @@
%prep
%setup -q
%patch0 -p1 -b .manpage
-#%patch1 -p1 -b .sock
-#%patch2 -p1 -b .253
-#%patch6 -p1 -b .librt
-#%patch7 -p1 -b .err
-#%patch8 -p1 -b .absn
-#%patch9 -p1 -b .argv
-#%patch10 -p1 -b .dots
+%patch1 -p1 -b .sock
+%patch2 -p1 -b .253
+%patch6 -p1 -b .librt
+%patch7 -p1 -b .err
+%patch8 -p1 -b .absn
+%patch9 -p1 -b .argv
+%patch10 -p1 -b .dots


4.產生 RPM 檔:

程式碼:
rpmbuild -ba /usr/src/redhat/SPECS/tar.spec


5.安裝升級 tar:

程式碼:
rpm -Uvh /usr/src/redhat/RPMS/i386/tar-1.20-vic.i386.rpm


6.不再出現警告訊息:

程式碼:
tar xjf tar-1.20.tar.bz2

tar --version
tar (GNU tar) 1.20
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值