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

Miroslav Lichvar mlichvar at redhat.com
Wed Aug 22 17:31:26 UTC 2007

On Wed, Aug 22, 2007 at 01:07:37PM -0400, Tom Lane wrote:
> Miroslav Lichvar <mlichvar at redhat.com> writes:
> > On Wed, Aug 22, 2007 at 12:15:06PM -0400, Tom Lane wrote:
> >> [tgl at 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.  They do change the list of zones
> and zone aliases now and then.

A %triggerin scriptlet could update the symlinks with every tzdata
update. ;)

> An idea that just came to me is to ship the rpm containing a single
> empty directory at /usr/share/pgsql/timezone (I assume RPM can handle
> removing the contents...) and then have a postinstall scriptlet that
> rmdir's the directory and creates the symlink instead.  This would
> leave the RPM manifest correctly showing ownership of one file there,
> but it would be a symlink not an empty directory.  Can anyone state
> whether RPM tracks file types closely enough to notice this?
> I really have no idea what level of detail is in its database...

I think rpm will just remove the files in /usr/share/zoneinfo as the
%post script will be executed before the files of the old package are
removed. A %posttrans scriptlet could be better.

Making the symlink as /usr/share/pgsql/zoneinfo and changing all paths
in postgresql accordingly is not an option?

Miroslav Lichvar

More information about the fedora-devel-list mailing list