Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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:
Embargoed:
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.