Bug 1043852

Summary: Yum does not properly honour %pretrans
Product: Red Hat Enterprise Linux 6 Reporter: Pablo Iranzo Gómez <pablo.iranzo>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: high    
Version: 6.5CC: james.antill, ksrot, packaging-team-maint, pmatilai, vmukhame
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-26 08:52:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1056252    

Description Pablo Iranzo Gómez 2013-12-17 10:53:01 UTC
Description of problem:
Yum is not honouring %pretrans:
#################################
Total size: 18
Installed size: 18
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : pretest2-1.0.0-7.lrh6.noarch                                                                                                                        1/1
this is pretrans
Starting post install for pretest2-1.0.0.7.lrh6 at Fri Dec 13 11:54:46 CST 2013
#################################

Which should be running before the 'Running transaction'



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

yum-plugin-downloadonly-1.1.30-14.el6.noarch
yum-3.2.29-43.el6_5.noarch
yum-plugin-security-1.1.30-14.el6.noarch
rpm-4.8.0-37.el6.x86_64
rpm-python-4.8.0-37.el6.x86_64
yum-utils-1.1.30-14.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
rpm-libs-4.8.0-37.el6.x86_64
yum-rhn-plugin-0.9.1-49.el6.noarch
[root@iranzo ~]# 


How reproducible:
- Create a spec file with a %pretrans section doing 'echo'
- Install it using yum


Actual results:
- 'Text' will be displayed after running transaction 

Expected results:
- 'Text' should be displayed before running transaction

Comment 2 Pablo Iranzo Gómez 2013-12-17 10:57:34 UTC
Fedora 20 still has this issue, but shows messages at a different point during yum installation (but still not prior to Running transaction)

rpm-4.11.1-7.fc20.x86_64
rpm-build-4.11.1-7.fc20.x86_64
rpm-build-libs-4.11.1-7.fc20.x86_64
rpm-libs-4.11.1-7.fc20.x86_64
rpm-python-4.11.1-7.fc20.x86_64

yum-3.4.3-120.fc20.noarch
yum-langpacks-0.4.3-1.fc20.noarch
yum-metadata-parser-1.1.4-9.fc20.x86_64
yum-plugin-fastestmirror-1.1.31-18.fc20.noarch
yum-plugin-merge-conf-1.1.31-18.fc20.noarch
yum-plugin-remove-with-leaves-1.1.31-18.fc20.noarch
yum-plugin-show-leaves-1.1.31-18.fc20.noarch
yum-plugin-versionlock-1.1.31-18.fc20.noarch
yum-utils-1.1.31-18.fc20.noarch
yumex-3.0.13-1.fc20.noarch

Comment 3 Panu Matilainen 2013-12-17 11:04:07 UTC
When %pretrans gets run is not in yum's control, %pretrans is executed by rpm it always occurs in the same spot. The *output* can (and often does) come later because of how yum wraps the logging from rpm.