[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: RPM upgrade problem: howto replace a directory with a symlink?



On Wednesday 22 August 2007, Tom Lane wrote:
> Miroslav Lichvar <mlichvar redhat com> writes:
> > On Wed, Aug 22, 2007 at 12:15:06PM -0400, Tom Lane wrote:
> >> [tgl rh2 x86_64]$ sudo rpm -F postgresql-8.2.4-4.x86_64.rpm
> >> postgresql-serv... error: unpacking of archive failed on file
> >> /usr/share/pgsql/timezone: cpio: rename failed - Is a directory
> >
> > It's an old bug in rpm, can't find it in bugzilla atm. The workaround
> > is to symlink everything in the directory, not sure how stable is the
> > content of /usr/share/zoneinfo though. I've done this in ncurses
> > package.
>
> Egad, that seems pretty horrid.

Agreed.  Not pretty either, but IMHO better than symlinking everything, 
something like this could work too:

%pre
# Can't overwrite dir with a symlink, so remove the old dir first on upgrades
[ $1 -gt 1 -a -d /usr/share/pgsql/timezone ] && \
rm -rf /usr/share/pgsql/timezone || :

...and then drop the symlink in place just as usual in %files.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]