Red Hat Bugzilla – Bug 449448
yum: packages with %pretrans fail to install
Last modified: 2014-01-21 18:03:02 EST
$ 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:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
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
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'
This is known and fixed in yum upstream and in F9. It's unclear whether or not
we'll backport at this time.
thx for the quick feedback, I guess we'll have to figure out a way to simply
avoid using %pretrans in the short-term.
As a general rule avoid %pretrans, %postrans and triggers.
they are painful.
Especially %pretrans. Because it's hard to run a script in an empty chroot...
I know all that, but %pretrans was the only/best way to work around some borkage
in our local/site packages. I'll deal. :)
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.
yum 3.2.19 in f8 updates-testing fixes this problem.