On Wed, 23 Oct 2013 14:25, Johannes Meixner <jsmeix@...> wrote:
Hello,
On Oct 19 16:52 K?ištof Želechovski wrote (excerpt):
Dnia ?roda, 16 pa?dziernika 2013 09:50:20 Johannes Meixner pisze:
I assume you do a RPM package upgrade and it is a directory in the already installed old version which was changed into a symbolic link in the new version.
Such a change is not possible with RPM.
I think you could %pre rmdir, %files %exclude the link and %post ln -s as required.
Did you test it?
As far as I know it cannot work because %post runs too early (before the old files are removed) where %post means the %post of the new package because one cannot modify the scriptlets of the old (i.e already installed) package.
See "the order in which scripts are executed on a single package upgrade" in /usr/share/doc/packages/rpm/manual/triggers
Full spot on! It's a giant trap. Last time I had to do some thing like that, is was moving config files, and they could have been modified: %pre scriptlet { test -L "old-link" && rm "old-link" test -d "old-dir" && mv old-dir new-pos test -d "new-pos" || mkdir "new-pos" ln -s new-pos old-dir-pos } Then the usual things with <file>.rpmnew durin upgrade worked just fine The trick is: ALL steps in %pre, otherwise head, meet desk! - Yamaban.