Problem changing symlink to directory with %pretrans scriptlet
pmatilai at laiskiainen.org
Tue Jan 7 07:43:50 UTC 2014
On 01/06/2014 11:47 PM, Bill Nottingham wrote:
> Richard Fearn (richardfearn at gmail.com) said:
>> On 28 December 2013 16:43, Bruno Wolff III <bruno at wolff.to> wrote:
>>> Notes that you need to use lua in pretrans scriptlets, not shell commands.
>> Thanks. I've already seen that. It doesn't seem to make any difference
>> whether it's a bash scriptlet or a lua scriptlet, though; irrespective
>> of what language is used to delete the symlink, the problem still
>>> I haven't found an example for you to copy, but note there are still some
>>> cases where changing symlinks to directories or vise versa won't work with
>>> rpm (https://bugzilla.redhat.com/show_bug.cgi?id=975909).
>> I think deleting the symlink manually may be revealing a problem in
>> rpm. It seems to treat /usr/share/javadoc/test-1/
>> hello (from the old
>> package) and /usr/share/javadoc/test/hello (from the new package) as
>> the same thing. Since the new package is installing
>> /usr/share/javadoc/test/hello, it therefore decides to 'skip' the old
>> 'hello' file, rather than 'erase' it.
>> I'm not sure yet why these two paths are considered to be the same...
> I believe (but can't confirm ATM) that file disposition checks (i.e., which
> files are added/removed/replaced) happen before pretrans scripts. So if
> you're using pretrans scripts to change paths that were valid
> pre-transaction to something else, weird results may happen.
%pretrans runs before the file disposition checks precisely to allow
these kinds of hacks to work ... and that's also the very reason it's so
problematic in many ways.
I saw this thread during the x-mas period but apparently forgot to
reply: Richards reproducer appears to point out a regression (in rpm >=
4.11, or perhaps surface a long-dormant bug in a piece of
symlink-checking code which was previously broken. Or then its been
there all along but never reported with an actual reproducer. Not sure
which one yet...
- Panu -
More information about the devel