Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
Regards, Julian
W dniu 21.09.2012 08:53, Julian Sikorski pisze:
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
Regards, Julian
It seems to have gone through upon the second attempt. Odd.
Julian
On 09/21/2012 09:22 AM, Julian Sikorski wrote:
W dniu 21.09.2012 08:53, Julian Sikorski pisze:
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
Regards, Julian
It seems to have gone through upon the second attempt. Odd.
Was the directory empty before installing the rpm replacing the directory with a symlink?
I could be wrong, but IIRC, current rpm is only able to handle dir->symlink replacers when "dir"s are empty.
Ralf
On 09/21/2012 10:27 AM, Ralf Corsepius wrote:
On 09/21/2012 09:22 AM, Julian Sikorski wrote:
W dniu 21.09.2012 08:53, Julian Sikorski pisze:
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
Regards, Julian
It seems to have gone through upon the second attempt. Odd.
Was the directory empty before installing the rpm replacing the directory with a symlink?
I could be wrong, but IIRC, current rpm is only able to handle dir->symlink replacers when "dir"s are empty.
A directory (empty or not) can't be automatically replaced by anything else (symlink or otherwise) in the existing rpm versions. If absolutely necessary, it can be accomplished by doing the necessary renames and symlinks in "%pretrans -p <lua>" scriptlet, but that should be only seen as the last resort as its not exactly a safe operation.
- Panu -
triggers could be used too (to rm -fr the directory installed by old versions of the package)
Another *be careful* warning for this one too.
----- Original Message ----- From: "Panu Matilainen" pmatilai@laiskiainen.org To: devel@lists.fedoraproject.org Sent: Friday, September 21, 2012 4:17:27 AM Subject: Re: replacing folders with symlinks leads to rpm cpio rename errors
On 09/21/2012 10:27 AM, Ralf Corsepius wrote:
On 09/21/2012 09:22 AM, Julian Sikorski wrote:
W dniu 21.09.2012 08:53, Julian Sikorski pisze:
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
Regards, Julian
It seems to have gone through upon the second attempt. Odd.
Was the directory empty before installing the rpm replacing the directory with a symlink?
I could be wrong, but IIRC, current rpm is only able to handle dir->symlink replacers when "dir"s are empty.
A directory (empty or not) can't be automatically replaced by anything else (symlink or otherwise) in the existing rpm versions. If absolutely necessary, it can be accomplished by doing the necessary renames and symlinks in "%pretrans -p <lua>" scriptlet, but that should be only seen as the last resort as its not exactly a safe operation.
- Panu -
Quoting Panu Matilainen (2012-09-21 10:17:27)
A directory (empty or not) can't be automatically replaced by anything else (symlink or otherwise) in the existing rpm versions. If absolutely necessary, it can be accomplished by doing the necessary renames and symlinks in "%pretrans -p <lua>" scriptlet, but that should be only seen as the last resort as its not exactly a safe operation.
This used to work in %pre scriptlet as well. It seems like RPM is now doing some additional checks and it will not even get to the point of %pre scriptlet. As far as I can see for F17/F18 %pre scriptlet will work, but F19+ %pretrans has to be used, correct?
Since I *knew* we used %pre for this exact problem before, I have used it and it broke upgrade paths[1]. I assume just rewriting %pre[2] into following %pretrans will work:
for key, dir in pairs({"boot", "conf"}) do path = "%{_datadir}/%{name}/" .. dir if posix.readlink(path) then os.remove(path) end end:
It certainly seemed to work now, but I wonder if I am just missing something else.
[1] https://admin.fedoraproject.org/updates/FEDORA-2013-9207/xmvn-0.5.0-2.fc19 [2] http://pkgs.fedoraproject.org/cgit/xmvn.git/tree/xmvn.spec#n117
On 05/28/2013 06:50 PM, Stanislav Ochotnicky wrote:
Quoting Panu Matilainen (2012-09-21 10:17:27)
A directory (empty or not) can't be automatically replaced by anything else (symlink or otherwise) in the existing rpm versions. If absolutely necessary, it can be accomplished by doing the necessary renames and symlinks in "%pretrans -p <lua>" scriptlet, but that should be only seen as the last resort as its not exactly a safe operation.
This used to work in %pre scriptlet as well. It seems like RPM is now doing some additional checks and it will not even get to the point of %pre scriptlet. As far as I can see for F17/F18 %pre scriptlet will work, but F19+ %pretrans has to be used, correct?
%pre was never correct for the task because it means rpm wont know about the change, which can cause side-effects like files from the new package removed on cleanup of the older package, junk left behind etc. What exactly happens depends on the details.
And yes, rpm >= 4.11 enforces use of %pretrans for the purpose as it detects the issue early on, whereas older versions just merrily go ahead and likely ends up making a mess during the transaction.
Since I *knew* we used %pre for this exact problem before, I have used it and it broke upgrade paths[1]. I assume just rewriting %pre[2] into following %pretrans will work:
for key, dir in pairs({"boot", "conf"}) do path = "%{_datadir}/%{name}/" .. dir if posix.readlink(path) then os.remove(path) end end:
It certainly seemed to work now, but I wonder if I am just missing something else.
Yup, something like that.
- Panu -
[1] https://admin.fedoraproject.org/updates/FEDORA-2013-9207/xmvn-0.5.0-2.fc19 [2] http://pkgs.fedoraproject.org/cgit/xmvn.git/tree/xmvn.spec#n117
It worked because the first (broken) installation at least removed the old version with the real directory.
Then on the second time the old version was no longer there, so no real directory and then the symlink could be installed.
But this means a manual process: install once, remove, install again which is probably not pratical for distribution on RHN.
--Fernando
----- Original Message ----- From: "Julian Sikorski" belegdol@gmail.com To: "Development discussions related to Fedora" devel@lists.fedoraproject.org Sent: Friday, September 21, 2012 3:22:12 AM Subject: Re: replacing folders with symlinks leads to rpm cpio rename errors
W dniu 21.09.2012 08:53, Julian Sikorski pisze:
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
Regards, Julian
It seems to have gone through upon the second attempt. Odd.
Julian
Quoting Julian Sikorski (2012-09-21 08:53:26)
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
http://bugzilla.redhat.com/show_bug.cgi?id=447156
Generally a bad idea to change symlinks and directories. You'd need a post/postun scriptlets and it will get tricky fast
W dniu 21.09.2012 10:34, Stanislav Ochotnicky pisze:
Quoting Julian Sikorski (2012-09-21 08:53:26)
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
http://bugzilla.redhat.com/show_bug.cgi?id=447156
Generally a bad idea to change symlinks and directories. You'd need a post/postun scriptlets and it will get tricky fast
Thank you for the information. I think I'll keep the folders as-is and symlink to files inside then.
Regards, Julian
On Fri, Sep 21, 2012 at 3:41 AM, Julian Sikorski belegdol@gmail.com wrote:
W dniu 21.09.2012 10:34, Stanislav Ochotnicky pisze:
Quoting Julian Sikorski (2012-09-21 08:53:26)
Hi list,
one of the updates I am preparing is supposed to replace some of the folders with symlinks. Unfortunately, this leads to rpm cpio: rename errors upon an update attempt. Is there a standard way of dealing with this?
http://bugzilla.redhat.com/show_bug.cgi?id=447156
Generally a bad idea to change symlinks and directories. You'd need a post/postun scriptlets and it will get tricky fast
Thank you for the information. I think I'll keep the folders as-is and symlink to files inside then.
The gallery2 package has some bits that might be of use as examples.
-J
Regards, Julian -- devel mailing list devel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/devel