Richard Fearn (richardfearn(a)gmail.com) said:
On 28 December 2013 16:43, Bruno Wolff III <bruno(a)wolff.to>
wrote:
>
https://fedoraproject.org/wiki/Packaging:Guidelines#The_.25pretrans_scrip...
> 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
occurs.
> 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.
Bill