Problem changing symlink to directory with %pretrans scriptlet

Richard Fearn richardfearn at
Sat Dec 28 13:23:35 UTC 2013

Hi all,

I'm trying to change a symlink to a directory but it's not working.
I've reduced the problem down to a simple test case.

This package:

creates the following:

* a directory /usr/share/javadoc/test-1 (named after the package version)
* a file within the test-1 directory
* /usr/share/javadoc/test, a symlink to test-1

In the next version:

the Javadoc directory is unversioned, so the 'test' symlink is now a
directory (containing one file). As expected the 1-1 to 1-2 upgrade

  file /usr/share/javadoc/test from install of test-1-2.fc20.noarch
conflicts with file from package test-1-1.fc20.noarch

So in the next version:

a %pretrans scriptlet deletes /usr/share/javadoc/test, if it's a
symlink. However during the 1-1 to 1-3 upgrade, the old test-1
directory isn't deleted.

The verbose rpm output from this upgrade:

shows that rpm doesn't erase /usr/share/javadoc/test-1/hello. It does
seem to try to erase the /usr/share/javadoc/test-1 directory, but
can't because it still contains a file.

Does anyone have any idea what's going on here?



Richard Fearn
richardfearn at

More information about the devel mailing list