Bug 452289

Summary: service-menu-installer ignores symlinks on uninstall
Product: [Applications] dolphin Reporter: Christian Hartmann <hartmann.christian>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kfm-devel, nate
Priority: NOR    
Version: 21.12.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 22.08
Sentry Crash Report:

Description Christian Hartmann 2022-04-05 10:27:22 UTC
SUMMARY
***
service-menu-installer ignores <package-name>.tar.gz-dir/uninstall.sh
if this is actualy just a symbolic link to install.sh in the same directory
(hardlinks and copies worked)
***


STEPS TO REPRODUCE
1. create a context menu extension as an archive with install.sh and run $ ln  -sf  install.sh  uninstall.sh 
2. run servicemenuinstaller install <package-name-tar-gz>
3. run servicemenuinstaller uninstall <package-name-tar-gz>

OBSERVED RESULT
package is not deinstalled

EXPECTED RESULT
package will be deinstalled

SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
X11
KDE neon 5.24
Comment 1 Bug Janitor Service 2022-05-17 11:48:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/371
Comment 2 Christian Hartmann 2022-05-21 09:37:42 UTC
Git commit 65413bbad29ea31ea0fab83bbe0f55a3befc5a11 by Christian Hartmann.
Committed on 21/05/2022 at 06:21.
Pushed by felixernst into branch 'master'.

fix: service-menu-installer ignoring symlinks on un-install

service-menu-installer ignores <package-name>.tar.gz-dir/uninstall.sh
if this is actualy just a symbolic link to install.sh in the same directory
(hardlinks and copies work)

canonicalPath() is used to get the name of the file on disk and returns install.sh
in the case of a symbolic link. install.sh without any arguments is called instead
of uninstall.sh consequently and no de-installation takes place.

replace canonicalPath() with absolutePath() as used in the rest of source file

resolves:

M  +1    -1    src/settings/contextmenu/servicemenuinstaller/servicemenuinstaller.cpp

https://invent.kde.org/system/dolphin/commit/65413bbad29ea31ea0fab83bbe0f55a3befc5a11