Bug 1000003

Summary: plasma5-openSUSE changed symlink to directory
Product: [openSUSE] openSUSE Distribution Reporter: Fabian Vogt <fvogt>
Component: KDE Workspace (Plasma)Assignee: Michael Schröder <mls>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: fvogt, lnussel, ma, okurz
Version: Leap 42.2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Fabian Vogt 2016-09-20 17:34:06 UTC
plasma5-theme-openSUSE installs the file /usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components/SessionManagementScreen.qml
plasma5-workspace installs /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/components/SessionManagementScreen.qml

zypper reports that those conflict, but the path is different. There are no sym- or hardlinks involved.
Comment 1 Fabian Vogt 2016-09-20 17:40:07 UTC
I hit the issue once while developing the branding package but thought it was just me having screwed around with those files too much. Now openQA spotted it as well: https://openqa.opensuse.org/tests/266737#step/zdup/96
Comment 2 Michael Schröder 2016-09-21 08:21:56 UTC
Why do you say that no symlinks are involved? The plasma5-workspace-branding-openSUSE-13.2-21.1 package from Leap 42.1 contains:

lrwxrwxrwx    1 root    root                       48 Oct 28 05:36 /usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components -> ../../org.kde.breeze.desktop/contents/components

Thus the conflict seems valid to me.
Comment 3 Fabian Vogt 2016-09-21 08:33:27 UTC
(In reply to Michael Schröder from comment #2)
> Why do you say that no symlinks are involved? The
> plasma5-workspace-branding-openSUSE-13.2-21.1 package from Leap 42.1
> contains:
> 
> lrwxrwxrwx    1 root    root                       48 Oct 28 05:36
> /usr/share/plasma/look-and-feel/org.openSUSE.desktop/contents/components ->
> ../../org.kde.breeze.desktop/contents/components
> 
> Thus the conflict seems valid to me.

That is the old version of the package that is replaced by a new one, that does not use a symlink any more.
Comment 4 Michael Schröder 2016-09-21 08:40:52 UTC
Why would that matter? The openQA test is trying to upgrade from 42.1 to 42.2, so the symlink exists when zypper is run.

Note that you simply *cannot* replace a directory with a symlink and vice versa with a package update.
Comment 5 Fabian Vogt 2016-09-21 08:47:55 UTC
(In reply to Michael Schröder from comment #4)
> Why would that matter? The openQA test is trying to upgrade from 42.1 to
> 42.2, so the symlink exists when zypper is run.
> 
> Note that you simply *cannot* replace a directory with a symlink and vice
> versa with a package update.

That's bad... What has to be done to accomplish this? The symlink _has_ to be replaced by a real directory.
Comment 6 Michael Schröder 2016-09-21 09:03:45 UTC
Sorry, not possible. rpm-wise you could do some magic with a pre-trans script written in lua, but the file conflict check is done before any transaction is run.

CC Michael Andres for advice.
Comment 7 Ludwig Nussel 2016-09-21 09:16:13 UTC
The issue was introduced with an online update of 42.1, right? So could we fix the issue in 42.1 by undoing the symlink there? Since the file content is identical in 42.1 there should actually be no file conflict.
Comment 8 Fabian Vogt 2016-09-21 09:23:58 UTC
(In reply to Ludwig Nussel from comment #7)
> The issue was introduced with an online update of 42.1, right? So could we
> fix the issue in 42.1 by undoing the symlink there? Since the file content
> is identical in 42.1 there should actually be no file conflict.

Tumbleweed has the issue as well.
Comment 9 Michael Andres 2016-09-21 10:12:10 UTC
(In reply to Michael Schröder from comment #6)
> Sorry, not possible. rpm-wise you could do some magic with a pre-trans
> script written in lua, but the file conflict check is done before any
> transaction is run.
> 
> CC Michael Andres for advice.

Does rpm execute the pre-trans before checking for file conflicts? Anyway, we don't have any execution hook before the fileconflict check in libzypp.
Comment 10 Fabian Vogt 2016-09-21 10:52:26 UTC
*** Bug 1000001 has been marked as a duplicate of this bug. ***
Comment 11 Michael Schröder 2016-09-21 10:55:42 UTC
(Yes, IIRC pretrans is run before the file conflict check. Which is highly dubious as well, as your system may be in a weird state after the pretrans scripts are run. But redhat did it that way because of their /usr move.)
Comment 12 Richard Brown 2016-09-21 11:57:23 UTC
*** Bug 1000002 has been marked as a duplicate of this bug. ***
Comment 13 Fabian Vogt 2016-09-27 11:51:10 UTC
The solution we came up with was:
- Rename the components directory to components-real during build
- Add a symlink components -> components-real

That way only the symlink target changes instead of the inode type.
However, this would break when updating the broken beta package to this one,
as the directory components would change _back_ to be a symlink again.
So a %pre script that does it for rpm got added and now everything should be fine...
Comment 14 Fabian Vogt 2016-09-28 12:26:19 UTC
*** Bug 1001667 has been marked as a duplicate of this bug. ***
Comment 15 Merrill Smith 2018-09-05 22:06:39 UTC
Author: mksmith
Date: 2018-09-05 16:06:24 -0600 (Wed, 05 Sep 2018)

New Revision: 188859

Log: [Bug 1000003] - A sample registry file to help the driver load properly, to be used AFTER installing the driver.

Added:
   branches/trunk.Migrate.MM/FileSystemMonitorDriver/driver/minispy.reg