FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > RPM Package Manager

 
 
LinkBack Thread Tools
 
Old 08-08-2008, 05:12 PM
Jos Vos
 
Default Disappearing symlinks in RPM transaction

Hi,

I have a interesting RPM problem that I can't explain (yet).

I have a package, say foo-1-1. It contains a directory, say /opt/foo

I want to make an update, say foo-1-2, in which /opt/foo is not a
directory anymore, but a symlink, say /opt/foo -> bar.
Just packaging it as such does not seem to work, as the RPM says then:

error: unpacking of archive failed on file /opt/foo: cpio: rename

So, I tried a workaround and included in foo no /opt/foo at all, but
I included a post-install script:

%post
ln -snf bar /opt/foo

Later, I added some tracing (writing output to a file there) and
found out that after at the end of the post-install script the
symlink *does* exist. But it is gone when the RPM transaction
is finished!

Can someone shed a light on this? I'm afraid the actual remove
actions for foo-1-1 remove my symlink. The only thing I want to
do is replacing a directory with a symlink in an update of the
package. How should I do this?

This is using RPM 4.4.2 on a RHEL5 clone.

Thanks,

--
-- Jos Vos <jos@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 08-08-2008, 05:55 PM
Jos Vos
 
Default Disappearing symlinks in RPM transaction

On Fri, Aug 08, 2008 at 07:12:05PM +0200, Jos Vos wrote:

> Can someone shed a light on this? I'm afraid the actual remove
> actions for foo-1-1 remove my symlink. The only thing I want to
> do is replacing a directory with a symlink in an update of the
> package. How should I do this?

To answer my own question, at least this seems to work:

%triggerpostun -- %{name} < %{version}-%{release}
ln -snf bar /opt/foo

Note that just "%triggerun" does not work, as this is run *before*
the actual files of the old version are removed.

Is this indeed the "recommended way"?

--
-- Jos Vos <jos@xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 08-08-2008, 05:56 PM
"Wichmann, Mats D"
 
Default Disappearing symlinks in RPM transaction

Jos Vos wrote:
> Hi,
>
> I have a interesting RPM problem that I can't explain (yet).
>
> I have a package, say foo-1-1. It contains a directory, say /opt/foo
>
> I want to make an update, say foo-1-2, in which /opt/foo is not a
> directory anymore, but a symlink, say /opt/foo -> bar.
> Just packaging it as such does not seem to work, as the RPM says then:
>
> error: unpacking of archive failed on file /opt/foo: cpio: rename

no light: been there, same problem, no joy.

In our particular case, a toolchain became multi-version capable,
and thus changed from providing /opt/foo/lib to providing
/opt/foo/lib-1.0, /opt/foo/lib-2.0, etc. with /opt/foo/lib
becoming a symlink to the latest version.

What I did find was if there was *anything* that depended on
the old way (and in our case there was), it messed up, so ended
up removing all the packages, installing the base, and building
up from there again. Not exactly a transition-aware upgrade


_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 08-08-2008, 06:45 PM
Michael Jennings
 
Default Disappearing symlinks in RPM transaction

On Friday, 08 August 2008, at 19:12:05 (+0200),
Jos Vos wrote:

> I have a interesting RPM problem that I can't explain (yet).
>
> I have a package, say foo-1-1. It contains a directory, say /opt/foo
>
> I want to make an update, say foo-1-2, in which /opt/foo is not a
> directory anymore, but a symlink, say /opt/foo -> bar.
> Just packaging it as such does not seem to work, as the RPM says then:
>
> error: unpacking of archive failed on file /opt/foo: cpio: rename
>
> So, I tried a workaround and included in foo no /opt/foo at all, but
> I included a post-install script:
>
> %post
> ln -snf bar /opt/foo
>
> Later, I added some tracing (writing output to a file there) and
> found out that after at the end of the post-install script the
> symlink *does* exist. But it is gone when the RPM transaction
> is finished!
>
> Can someone shed a light on this? I'm afraid the actual remove
> actions for foo-1-1 remove my symlink. The only thing I want to
> do is replacing a directory with a symlink in an update of the
> package. How should I do this?
>
> This is using RPM 4.4.2 on a RHEL5 clone.

The solution is %pretrans, which a quick Google search on "rpm upgrade
symlink directory" turns up right away:

https://lists.dulug.duke.edu/pipermail/rpm-devel/2007-April/002257.html

Michael

--
Michael Jennings (a.k.a. KainX) http://www.kainx.org/ <mej@kainx.org>
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"I have failed over and over again in my life. And that is why I
succeed." -- Michael Jordan

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 

Thread Tools




All times are GMT. The time now is 04:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org