Bug 449448 - yum: packages with %pretrans fail to install
yum: packages with %pretrans fail to install
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-06-02 13:12 EDT by Rex Dieter
Modified: 2014-01-21 18:03 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-09-03 09:36:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rex Dieter 2008-06-02 13:12:22 EDT
$ rpm -q yum

We've got a private/local repo with a package or 2 with %pretrans scriptlets. 
These are installable fine with rpm, but fail when trying to install with yum:

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
  File "/usr/share/yum-cli/yummain.py", line 183, in main
  File "/usr/share/yum-cli/cli.py", line 401, in doTransaction
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 591, in
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 315, in callback
    self._instCloseFile(  bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 378, in
    self.ts_done(txmbr.po, txmbr.output_state)
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 211, in ts_done
    te_fn = '%s/transaction-done.%s' % (self.base.conf.persistdir, self._ts_time)
AttributeError: RPMTransaction instance has no attribute '_ts_time'
Comment 1 Seth Vidal 2008-06-02 13:19:33 EDT
This is known and fixed in yum upstream and in F9. It's unclear whether or not
we'll backport at this time.

Comment 2 Rex Dieter 2008-06-02 13:25:59 EDT
thx for the quick feedback, I guess we'll have to figure out a way to simply
avoid using %pretrans in the short-term.
Comment 3 Seth Vidal 2008-06-02 13:33:26 EDT
As a general rule avoid %pretrans, %postrans and triggers.

they are painful.
Comment 4 Jeremy Katz 2008-06-02 13:41:09 EDT
Especially %pretrans.  Because it's hard to run a script in an empty chroot...
Comment 5 Rex Dieter 2008-06-02 13:46:40 EDT
I know all that, but %pretrans was the only/best way to work around some borkage
in our local/site packages.  I'll deal. :)
Comment 6 Panu Matilainen 2008-06-03 01:30:47 EDT
Part of the reason why %pretrans and %posttrans are painful is that they're used
so little that bugs like this don't get caught early on. For some things
%pretrans is really the one and only possibility atm and the empty chroot
doesn't matter as long as the embedded lua interpreter is used instead of
/bin/sh or such, and script is careful not assume things that might not be there.
Comment 7 seth vidal 2008-09-03 09:36:55 EDT
yum 3.2.19 in f8 updates-testing fixes this problem.

Note You need to log in before you can comment on or make changes to this bug.