[opensuse-packaging] RPM how to change a directory to a link
Hello, when there is in foo-1.rpm a directory /somewhere/foo/ but in foo-2.rpm it is a link /somewhere/foo -> /elsewhere/bar then "rpm --upgrade foo" fails with -------------------------------------------------------------- error: unpacking of archive failed on file /somewhere/foo: cpio: rename failed - Is a directory -------------------------------------------------------------- What is the officially blessed method to support such a change in the software in the RPM package of such a software? Assume that one cannot change the actual software. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Johannes Meixner (jsmeix@suse.de) [20110203 12:58]:
What is the officially blessed method to support such a change in the software in the RPM package of such a software?
RPM doesn't support it and AFAIK there is no workaround. Philipp -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le jeudi 03 février 2011 à 13:06 +0100, Philipp Thomas a écrit :
* Johannes Meixner (jsmeix@suse.de) [20110203 12:58]:
What is the officially blessed method to support such a change in the software in the RPM package of such a software?
RPM doesn't support it and AFAIK there is no workaround.
there is one :
in the %pre of the new package, check if the offending path is directory
and if it is, rm -fr it.. Ugly but it works..
--
Frederic Crozat
Hello, On Feb 3 13:10 Frederic Crozat wrote (excerpt):
Le jeudi 03 février 2011 à 13:06 +0100, Philipp Thomas a écrit :
* Johannes Meixner (jsmeix@suse.de) [20110203 12:58]:
What is the officially blessed method to support such a change in the software in the RPM package of such a software?
RPM doesn't support it and AFAIK there is no workaround.
there is one :
in the %pre of the new package, check if the offending path is directory and if it is, rm -fr it.. Ugly but it works..
Ugly and it does not work in any case. Assume in foo-1.rpm there is /somewhere/foo/ /somewhere/foo/somefile But in foo-2.rpm this was changed to /somewhere/foo -> /elsewhere/bar/ /elsewhere/bar/ /elsewhere/bar/somefile Now assume somehow "rm -r /somewhere/foo" happens before the files in foo-2.rpm are installed (it does not matter if the user root does it manually or via RPM preinstall scriptlet in foo-2.rpm). This makes things even worse because: Now "rpm --upgrade foo" does not show erros but results a broken installation because in the end /elsewhere/bar/somefile is not installed. Reasoning: During "rpm --upgrade foo" RPM detects that /somewhere/foo/somefile is an obsolete file (no longer in the files list of foo-2.rpm). Then RPM installs the cpio archive in foo-2.rpm which results those new stuff installed on the harddisk: /somewhere/foo -> /elsewhere/bar/ /elsewhere/bar/ /elsewhere/bar/somefile Finally RPM removes the obsolete files, in particular it removes /somewhere/foo/somefile which exists because of the link /somewhere/foo -> /elsewhere/bar/ so that RPM removes the new installed /elsewhere/bar/somefile which results a broken installation and "rpm --verify foo" shows the mess: ------------------------------------------------------------------ missing /elsewhere/bar/somefile ------------------------------------------------------------------ I found a workaround with sophisticated awkward hacks in the RPM spec file plus a special RPM scriplet (the basic idea is to get the stuff out of RPM's file list). But such a workaround will cause more issues in the future. In the worst case it will cause an endless sequence of further workarounds for workarounds for workarounds... In the end this means that currently it is not possible to make a sound RPM package when a directory is replaced by a symbolic link. But from a software developer point of view it should be perfectly o.k. to replace a directory by a link. One may think about a rename and a compatibility link why such a change might be done in a software. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex
On Wed, Feb 9, 2011 at 4:45 PM, Johannes Meixner
Ugly and it does not work in any case.
What do you think of this toy spec http://rpm5.org/cvs/chngview?cn=14827 for changing a directory with a symbolic link ? Regards -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hello, On Feb 9 17:01 yersinia wrote (excerpt):
... http://rpm5.org/...
We do not use "the official RPM Package Manager (RPM)" from rpm5.org but the "RPM Package Manager (RPM)" from rpm.org - for details see http://en.wikipedia.org/wiki/RPM_Package_Manager#Forks In openSUSE:Factory we have currently RPM version 4.8.0. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Thu, Feb 10, 2011 at 11:06 AM, Johannes Meixner
Hello,
On Feb 9 17:01 yersinia wrote (excerpt):
... http://rpm5.org/...
We do not use "the official RPM Package Manager (RPM)" from rpm5.org but the "RPM Package Manager (RPM)" from rpm.org - for details see http://en.wikipedia.org/wiki/RPM_Package_Manager#Forks
Sure, i know The example linked was valid also for rpm 4.4.2.x, RPM 4.8.0 and rpm5. I have written the toy spec, with another name, because noone care to answer on a similar #redhat bugzilla (in reality was closed with a "wont fix"). it is useful ? dunno. For the fork question everyone have its opinion but if you like give a look to https://answers.launchpad.net/rpm/+question/124225 Hope that my answers are useful for the question discussed here. Best Regards
In openSUSE:Factory we have currently RPM version 4.8.0.
Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany AG Nuernberg, HRB 16746, GF: Markus Rex -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, Feb 09, 2011 at 05:01:07PM +0100, yersinia wrote:
On Wed, Feb 9, 2011 at 4:45 PM, Johannes Meixner
wrote: Ugly and it does not work in any case.
What do you think of this toy spec http://rpm5.org/cvs/chngview?cn=14827 for changing a directory with a symbolic link ?
Does not work for me, as the uninstall of the old package removes the files from the new package and you end up with an empty /tmp/test-change-dir-to-symlink-directory dir. (And "%pretrans -p /usr/bin/lua" should be "%pretrans -p <lua>" to make it use rpm's internal lua) Cheers, Michael -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, Feb 14, 2011 at 2:51 PM, Michael Schroeder
On Wed, Feb 09, 2011 at 05:01:07PM +0100, yersinia wrote:
On Wed, Feb 9, 2011 at 4:45 PM, Johannes Meixner
wrote: Ugly and it does not work in any case.
What do you think of this toy spec http://rpm5.org/cvs/chngview?cn=14827 for changing a directory with a symbolic link ?
Does not work for me, as the uninstall of the old package removes the files from the new package and you end up with an empty /tmp/test-change-dir-to-symlink-directory dir.
(And "%pretrans -p /usr/bin/lua" should be "%pretrans -p <lua>" to make it use rpm's internal lua)
Bad link posted, sorry. There was in fact a typo in the first release in fact http://rpm5.org/cvs/fileview?f=rpm/tests/test-change-dir-to-symlink-1.1.spec&v=1.1 http://rpm5.org/cvs/fileview?f=rpm/tests/test-change-dir-to-symlink-1.2.spec&v=1.3 Better perhaps to do a cvs co of rpm5 HEAD. Exists also a my personal git repo of rpm5 on github or on launchpad I'm glad to know what you think, because the resolution of the problem is the same in rpm5.org and rpm.org (debian does not even support a change from manual directory with a symbolic link, or vice versa) Cheers Elia -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, Feb 14, 2011 at 05:28:43PM +0100, yersinia wrote:
Bad link posted, sorry. There was in fact a typo in the first release in fact
http://rpm5.org/cvs/fileview?f=rpm/tests/test-change-dir-to-symlink-1.1.spec&v=1.1 http://rpm5.org/cvs/fileview?f=rpm/tests/test-change-dir-to-symlink-1.2.spec&v=1.3
Better perhaps to do a cvs co of rpm5 HEAD. Exists also a my personal git repo of rpm5 on github or on launchpad
I'm glad to know what you think, because the resolution of the problem is the same in rpm5.org and rpm.org (debian does not even support a change from manual directory with a symbolic link, or vice versa)
Still doesn't work for me, after rpm -U test-change-dir-to-symlink-1-2.noarch.rpm the /tmp/test-change-dir-to-symlink-directory dir is empty because the uninstall of the -1.1 package (which is done after the install of 1.2) deletes the installed files. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (5)
-
Frederic Crozat
-
Johannes Meixner
-
Michael Schroeder
-
Philipp Thomas
-
yersinia