RPM

Comment 1 for bug 651436

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

Created attachment 368203
Proposed patch (backport from upstream)

+++ This bug was initially created as a clone of Bug #216221 +++

Description of problem:

If one package installation fails in scriptlet (%pre or %post) yum is not notified and still reports the package as installed.

Version-Release number of selected component (if applicable):

rpm-4.4.2.3-18.el5
yum-3.2.22-20.el5

How reproducible:

Always

Steps to Reproduce:
1. build foo and bar from attached src rpm
2. yum localinstall --nogpgcheck -y foo-1.0-1.noarch.rpm bar-1.0-1.noarch.rpm

Actual results:

Setting up Local Package Process
Examining foo-1.0-1.noarch.rpm: foo-1.0-1.noarch
Marking foo-1.0-1.noarch.rpm to be installed
Examining bar-1.0-1.noarch.rpm: bar-1.0-1.noarch
Marking bar-1.0-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package bar.noarch 0:1.0-1 set to be updated
---> Package foo.noarch 0:1.0-1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================
 Package Arch Version Repository Size
========================================================================
Installing:
 bar noarch 1.0-1 /bar-1.0-1.noarch 0.0
 foo noarch 1.0-1 /foo-1.0-1.noarch 0.0

Transaction Summary
========================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
error: %pre(bar-1.0-1.noarch) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping bar-1.0-1
  Installing : foo 2/2

Installed:
  bar.noarch 0:1.0-1 foo.noarch 0:1.0-1

Complete!

Expected results:

Setting up Local Package Process
Examining foo-1.0-1.noarch.rpm: foo-1.0-1.noarch
Marking foo-1.0-1.noarch.rpm to be installed
Examining bar-1.0-1.noarch.rpm: bar-1.0-1.noarch
Marking bar-1.0-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package bar.noarch 0:1.0-1 set to be updated
---> Package foo.noarch 0:1.0-1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================
 Package Arch Version Repository Size
========================================================================
Installing:
 bar noarch 1.0-1 /bar-1.0-1.noarch 0.0
 foo noarch 1.0-1 /foo-1.0-1.noarch 0.0

Transaction Summary
========================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Error in <unknown> scriptlet in rpm package bar-1.0-1.noarch
error: %pre(bar-1.0-1.noarch) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping bar-1.0-1
  Installing : foo 2/2

Installed:
  foo.noarch 0:1.0-1

Failed:
  bar.noarch 0:1.0-1

Complete!

Additional info:

yum-3.2.22 contains the required code but relies on the notification taht is present upstream in rpm 4.6.

The proposed patch here attached is a backport of the notification for failed scriptlet in rpm 4.4 so that yum rightfully reports the package that failed in scriptled.