rpm 回滚忽略 rpm - 无错误输出

rpm 回滚忽略 rpm - 无错误输出

问题

rpm 回滚无法与最近几天创建的一组重新打包的 rpm 一起工作,但是可以与较新的 rpm 一起工作。

[root@host1 repackage]# ls -l zsh-4.2.6-*
-rw-r--r-- 1 root root 1788283 Apr 10  2011 zsh-4.2.6-3.el5.i386.rpm
-rw-r--r-- 1 root root 1788691 Aug 18 04:38 zsh-4.2.6-5.el5.i386.rpm
[root@host1 repackage]# rpm -q zsh
zsh-4.2.6-6.el5
[root@host1 repackage]# rpm --test -Uvh --rollback 'Aug 18 01:00'
[root@host1 repackage]# rpm -e zsh
[root@host1 repackage]# 
[root@host1 repackage]# ls -l zsh*
-rw-r--r-- 1 root root 1788283 Apr 10  2011 zsh-4.2.6-3.el5.i386.rpm
-rw-r--r-- 1 root root 1788691 Aug 18 04:38 zsh-4.2.6-5.el5.i386.rpm
-rw-r--r-- 1 root root 1789064 Aug 20 09:06 zsh-4.2.6-6.el5.i386.rpm
[root@host1 repackage]# cp zsh-4.2.6-6.el5.i386.rpm /tmp
[root@host1 repackage]# rpm --test -Uvh --rollback 'Aug 18 01:00'
Rollback packages (+1/-0) to Mon Aug 20 09:02:16 2012 (0x50323558):
Preparing...                ########################################### [100%]
Cleaning up repackaged packages:
    Removing /var/spool/repackage/zsh-4.2.6-6.el5.i386.rpm:
[root@host1 repackage]# ls -l zsh-4.2.6-*
-rw-r--r-- 1 root root 1788283 Apr 10  2011 zsh-4.2.6-3.el5.i386.rpm
-rw-r--r-- 1 root root 1788691 Aug 18 04:38 zsh-4.2.6-5.el5.i386.rpm    
[root@host1 repackage]# cp /tmp/zsh-4.2.6-6.el5.i386.rpm  .
[root@host1 repackage]# rpm  -Uvh --rollback 'Aug 18 01:00'
Rollback packages (+1/-0) to Mon Aug 20 09:06:05 2012 (0x5032363d):
Preparing...                ########################################### [100%]
   1:zsh                    ########################################### [ 50%]
Cleaning up repackaged packages:
    Removing /var/spool/repackage/zsh-4.2.6-6.el5.i386.rpm:
[root@host1 repackage]# rpm --test -Uvh --rollback 'April 9'
[root@host1 repackage]# 

现在,如果我使用 -Uvvh 运行测试命令,我会收到 stderror 的调试消息,它显示 rpm 读取了 /var/spool/repackage 中的每个 rpm 文件。唯一有趣的一点是“预期大小”,但搜索后,预期大小应该有所不同,因为它按照文件系统上的格式记录文件。

D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Installtid rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#     769 Header sanity check: OK
D: ========== DSA pubkey id 53268101 37017186 (h#769)
D:  read h#      32 Header V3 DSA signature: OK, key ID 37017186
D:  read h#      40 Header V3 DSA signature: OK, key ID 37017186
...
D:  read h#    1753 Header V3 DSA signature: OK, key ID 37017186
D: Expected size:      3628918 = lead(96)+sigs(344)+pad(0)+data(3628478)
D:   Actual size:      3583695
D: /var/spool/repackage/Deployment_Guide-en-US-5.2-11.noarch.rpm: Header V3 DSA signature: OK, key ID 37017186
D: Expected size:      1100789 = lead(96)+sigs(344)+pad(0)+data(1100349)
D:   Actual size:      1109281
D: /var/spool/repackage/NetworkManager-0.7.0-10.el5_5.2.i386.rpm: Header V3 DSA signature: OK, key ID 37017186
D: Expected size:      1098167 = lead(96)+sigs(344)+pad(0)+data(1097727)
D:   Actual size:      1106179
D: /var/spool/repackage/NetworkManager-0.7.0-9.el5.i386.rpm: Header V3 DSA signature: OK, key ID 37017186
D: Expected size:        84351 = lead(96)+sigs(344)+pad(0)+data(83911)
D:   Actual size:        85378
...
D: Expected size:      1788276 = lead(96)+sigs(344)+pad(0)+data(1787836)
D:   Actual size:      1788691
D: /var/spool/repackage/zsh-4.2.6-5.el5.i386.rpm: Header V3 DSA signature: OK, key ID 37017186
D:      --- erase h#1758
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Installtid
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: May free Score board((nil))

我可以将这些 rpm 从重新打包目录中复制出来,如果我通过 cpio 运行它们,则可以提取文件。

我也尝试备份并重建 rpm 数据库 - 没有变化。

系统信息:
RHEL 5.8
rpm 4.4.2.3

/etc/yum.conf
tsflags=重新打包

/etc/rpm/macros
%_repackage_all_erasures 1

答案1

在与 RedHat 发生纠纷后,他们确认不支持 --rollback 选项并在 RHEL 6 中将其删除。

相关内容