helm-system-packages icon indicating copy to clipboard operation
helm-system-packages copied to clipboard

Use package-kit

Open DamienCassou opened this issue 6 years ago • 4 comments

PackageKit is an high-level interface to handle package managers of many distributions including apt, dnf, pacman, portage, urpmi...

To get the list of packages, you have to write something like that (in a buffer with lexical-binding:t):

(let ((transaction (dbus-call-method
                    :system
                    "org.freedesktop.PackageKit"
                    "/org/freedesktop/PackageKit"
                    "org.freedesktop.PackageKit"
                    "CreateTransaction"))
      (count 0))

  (dbus-register-signal
   :system
   "org.freedesktop.PackageKit"
   transaction
   "org.freedesktop.PackageKit.Transaction"
   "Package"
   (lambda (&rest arguments)
     ; in `arguments`, you get the package name, the installation status and a summary
     (cl-incf count)))

  (dbus-register-signal
   :system
   "org.freedesktop.PackageKit"
   transaction
   "org.freedesktop.PackageKit.Transaction"
   "Finished"
   (lambda (&rest arguments)
     (message "Finished with %d packages" count)))

  (dbus-call-method
   :system
   "org.freedesktop.PackageKit"
   transaction
   "org.freedesktop.PackageKit.Transaction"
   "GetPackages"
   :uint64 4))

DamienCassou avatar Sep 19 '18 15:09 DamienCassou

This is interesting.

I don't use it (it does not support Guix) so I'm not completely sure but my understanding is that it competes on the same level as Helm System Packages. While we can certainly re-use it, I wonder if there is an incentive for people using a PackageKit interface to use Helm System Packages.

@DamienCassou: Do you use any PackageKit interface? How does it compare to Helm System Packages? Are there missing features on both sides?

Anyways, if adding an interface to PackageKit allows Helm System Packages to support 4-5 more package managers, I guess it's a good idea to give it a shot.

Ambrevar avatar Sep 19 '18 16:09 Ambrevar

I don't use it (it does not support Guix)

Nix is supported ;-).

it competes on the same level as Helm System Packages

PackageKit abstracts away the package manager and provides a D-Bus API, a C library and a command-line interface. Some GUIs have been built on top, e.g., the Gnome Software application to install packages.

If you see helm-system-packages as an helm interface to control your package manager, then both would work quite fine together. Write a module for PackageKit and you can get rid of most of the other modules :-). I would certainly like to keep doing things from Emacs.

Do you use any PackageKit interface? How does it compare to Helm System Packages? Are there missing features on both sides?

I mostly used dnf on the command-line. Now I'm slowly switching to Helm System Packages. I rarely use Gnome Software.

DamienCassou avatar Sep 20 '18 07:09 DamienCassou

Is Nix supported? I don't see it here: https://www.freedesktop.org/software/PackageKit/pk-matrix.html.

I'm happy to merge a PackageKit interface. I won't get rid of the other interface though because:

  • Well, they work so far.
  • Some users might not have / want PackageKit.

Ambrevar avatar Sep 20 '18 08:09 Ambrevar

Pierre Neidhardt [email protected] writes:

Is Nix supported? I don't see it here: https://www.freedesktop.org/software/PackageKit/pk-matrix.html.

This website seems out of date. Here is the ./configure template:

https://github.com/hughsie/PackageKit/blob/master/configure.ac#L356

As you can see, there is a --enable-nix option.

-- Damien Cassou http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill

DamienCassou avatar Sep 20 '18 08:09 DamienCassou