The deb/rpm/pacman packages are now installed/uninstalled using packagekit.
Details
- Reviewers
ngraham elvisangelaccio meven - Group Reviewers
Dolphin - Commits
- R318:3e1cb2c7fb41: Dolphin: Implement package kit for deb/rpm/pacman service packages
Try to install deb package from kde store (search for jetbrains). Then uninstall it.
Diff Detail
- Repository
- R318 Dolphin
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
90 | Indentation seems of :/ way soo spacey |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
90 | How would it be better? Maybe define the lambdas before? |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
90 | That's a solution, or adding a function. |
You can mark what you did as done.
Seems to good me
Let's wait a little to have @elvisangelaccio review this.
Does PackageKit work on Windows/MacOS? I don't think so. We should probably run this code only on Unix, no?
src/settings/services/servicemenuinstaller/CMakeLists.txt | ||
---|---|---|
9 | Does this comment still apply after the latest update to the diff? |
src/settings/services/servicemenuinstaller/CMakeLists.txt | ||
---|---|---|
9 | It's ok now. |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
383 | I choose only these two because they are very common package formats and quite a few services in the store already have deb/rpm packages available. But I am unsure on how to check the mimetype for pacman packages, would it be enough to check for application/x-xz? |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
383 | https://en.wikipedia.org/wiki/List_of_archive_formats#Software_packaging_and_distribution |
Display error details instead of status code
If you uninstall a package that has already been uninstalled:
"Could not find package(s)"
Missing dependencies:
"The following packages have unmet dependencies:\n dolphin-jetbrainsservicemenu: Depends: kiooooo (>= 5.44) but it is not installable\n"
I get a CMake error:
CMake Error at src/settings/services/servicemenuinstaller/CMakeLists.txt:11 (target_link_libraries): The keyword signature for target_link_libraries has already been used with the target "servicemenuinstaller". All uses of target_link_libraries with a target must be either all-keyword or all-plain. The uses of the keyword signature are here: * src/settings/services/servicemenuinstaller/CMakeLists.txt:5 (target_link_libraries)
src/settings/services/servicemenuinstaller/CMakeLists.txt | ||
---|---|---|
12 | Add PRIVATE as well here. |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
34 | This should include application/x-bzip2 as well. Also, it would probably be optimal to query what PackageKit backend is currently being used and set associations based on that. |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
---|---|---|
34 | qWarning() << "Mime types:" << PackageKit::Daemon::mimeTypes(); returns an empty list, I don't know why. And application/x-bzip2 is already in the list of file formats used for decompression. (Line 150). |
Installation for the JetBrains plugin claims to succeed, the my package manager says it's not actually installed, and indeed it doesn't appear in the plugins list in Dolphin. It is marked as installed in the GHNS dialog though, ans clicking "uninstall" displays and error message that is also not totally visible (which not your fault; this would need to be fixed in the GHNS dialog):
It seems like the installation did not in fact succeed, even though it claims to have.
What kind of GHNS dialog you spot about? It's a service menu, right click on supported file format (deb, rpm, zst)
I can't reproduce the install issue.
And it being marked as installed even if it is not installed (in the dolphin dialog)is another issue in KNS.
But the uninstall is generally broken, see D29101.
CMakeLists.txt | ||
---|---|---|
87 | Please call it HAVE_PACKAGEKIT instead. | |
88–91 | Please create a config-packagekit.h.cmake file instead. See src/CMakeLists.txt as example: configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h) configure_file(config-kactivities.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kactivities.h) | |
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp | ||
74 | Please call it exitWithError() or similar instead, since this is what this lambda actually does. | |
89 | Same here. | |
112 | Same here: please don't use booleans as arguments. | |
115–116 | Please use QFileInfo::exists() instead. |
Make sure to exit
When you install for example an rpm package on KDE Neon with the servicemenu installer
you get the warning that the mime type is not supported. But not every time.
In that case finished is emitted but errorCode not.
Now there is a timer (500 ms) which exits after the packagekit
operation unsucessfully finished. In this time
the errorCode slot can be called and we can be sure that the installer will exit.
But now this patch should be done ;-)
Hmm, I'm still not seeing this work for me. PackageKit clearly trie to install it (as verified by pkmon) but the transaction still fails:
. Here's the pkmon log:However, the GHNS dialog still reports success.
:-(
Does it work if you install install the deb package using apt on the command line?
Ah, it fails doing it by hand too:
nate@spectre:~/kde/src/kirigami$ (master) sudo zypper install /home/nate/Desktop/dolphin-jetbrainsservicemenu-1.1.0-Linux.rpm Loading repository data... Reading installed packages... Resolving package dependencies... The following NEW package is going to be installed: dolphin-jetbrainsservicemenu 1 new package to install. Overall download size: 50.8 KiB. Already cached: 0 B. After the operation, additional 120.5 KiB will be used. Continue? [y/n/v/...? shows all options] (y): y Retrieving package dolphin-jetbrainsservicemenu-1.1.0-1.x86_64 (1/1), 50.8 KiB (120.5 KiB unpacked) dolphin-jetbrainsservicemenu-1.1.0-Linux.rpm: Package is not signed! dolphin-jetbrainsservicemenu-1.1.0-1.x86_64 (Plain RPM files cache): Signature verification failed [6-File is unsigned]
pkcon install-local /home/nate/Desktop/dolphin-jetbrainsservicemenu-1.1.0-Linux.rpm Installing files [=========================] Testing changes [=========================] Finished [ ] (0%) The following packages have to be installed: dolphin-jetbrainsservicemenu-1.1.0-1.x86_64 Plugin to open folders in Dolphin with the Jetbrains IDEs Proceed with changes? [N/y] y [=========================] Installing files [=========================] Waiting for authentication [=========================] Starting [=========================] Resolving dependencies [=========================] Installing packages [=========================] Finished [=========================] Fatal error: Installation has been aborted as directed. nate@spectre:~/kde/src/kirigami$ (master) echo $? 7
So packagekit doesn't give us the best error message in the world compared to the package manager, but it does appear to have one and be return a non-zero status, which we should be catching here if possible.
Show error message in kdialog
I was going to do this in a follow up patch but I guess it is ok here :-).
However, the GHNS dialog still reports success.
This is a problen in GHNS, I will write a patch for this.
Yay!
I wouldn't exactly call this error message useful though:
However that's PackageKit's fault, not yours. Shipit!