Skip to content

Commit

Permalink
Remove PackageKit plugin
Browse files Browse the repository at this point in the history
This stopped working with packagekit 1.0 as its apt backend is gone and aptcc
does not support plugins.
  • Loading branch information
martinpitt committed Aug 16, 2016
1 parent 7a1501b commit 373f44e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 350 deletions.
53 changes: 0 additions & 53 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -45,59 +45,6 @@ These functions only use python-apt. They do not need any other dependencies,
root privileges, D-BUS calls, etc.


PackageKit API
--------------
If you want to integrate driver lookups in software which should not be
distribution specific, or is not written in Python, you should use the
PackageKit API instead of the UbuntuDrivers.detect Python module. In
particular, ubuntu-drivers-common ships PackageKit plugins for the
"WhatProvides" PackageKit query for the types "MODALIAS" (corresponding to
UbuntuDrivers.detect.packages_for_modalias()), and "HARDWARE_DRIVER"
(corresponding to UbuntuDrivers.detect.system_driver_packages()).
This also works with aptdaemon's PackageKit compatibility layer
(python-aptdaemon.pkcompat), which is the preferred PackageKit API
implementation in Ubuntu.

Please see

http://www.packagekit.org/gtk-doc/PackageKit-pk-client-sync.html#pk-client-what-provides

about the WhatProvides() API, and

https://gitorious.org/packagekit/packagekit/blobs/master/docs/provides-component-naming.txt

for details about the various WhatProvides types.

Examples:

From Python:

>>> from gi.repository import PackageKitGlib
>>> pk = PackageKitGlib.Client()

>>> res = pk.what_provides(PackageKitGlib.FilterEnum.NONE, PackageKitGlib.ProvidesEnum.MODALIAS, ["pci:v000010DEd000007E3sv00sd00bc03sc00i00"], None, lambda p, t, d: True, None)
>>> res.get_exit_code()
<enum PK_EXIT_ENUM_SUCCESS of type PkExitEnum>
>>> for p in res.get_package_array(): print p.get_id()
nvidia-current;295.53-0ubuntu1;amd64;Ubuntu
nvidia-current-updates;295.53-0ubuntu1;amd64;Ubuntu

>>> res = pk.what_provides(PackageKitGlib.FilterEnum.NONE, PackageKitGlib.ProvidesEnum.HARDWARE_DRIVER, ["drivers_for_attached_hardware"], None, lambda p, t, d: True, None)
>>> res.get_exit_code()
<enum PK_EXIT_ENUM_SUCCESS of type PkExitEnum>
>>> for p in res.get_package_array(): print p.get_id()
open-vm-dkms;2011.12.20-562307-0ubuntu1;all;Ubuntu

Using the pkcon command line tool:

$ pkcon what-provides "pci:v000010DEd000007E3sv00sd00bc03sc00i00"
Available nvidia-current-295.49-0ubuntu1.amd64 NVIDIA binary Xorg driver, kernel module and VDPAU library
Available nvidia-current-updates-295.49-0ubuntu1.amd64 NVIDIA binary Xorg driver, kernel module and VDPAU library

$ pkcon what-provides "drivers_for_attached_hardware"
Available open-vm-dkms-2011.12.20-562307-0ubuntu1.all Source for VMware guest systems driver (DKMS)


Detection logic
---------------
The principal method of mapping hardware to driver packages is to use modalias
Expand Down
66 changes: 0 additions & 66 deletions UbuntuDrivers/PackageKit.py

This file was deleted.

3 changes: 1 addition & 2 deletions UbuntuDrivers/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def system_modaliases():
This ignores devices whose drivers are statically built into the kernel, as
you cannot replace them with other driver packages anyway.
Return a modalias → sysfs path map. The keys of the returned map are
suitable for a PackageKit WhatProvides(MODALIAS) call.
Return a modalias → sysfs path map.
'''
aliases = {}
for path, dirs, files in os.walk('/sys/devices'):
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ubuntu-drivers-common (1:0.4.20) UNRELEASED; urgency=medium

* Remove PackageKit plugin. This stopped working with packagekit 1.0 as its
apt backend is gone and aptcc does not support plugins.

-- Martin Pitt <[email protected]> Tue, 16 Aug 2016 11:41:07 +0200

ubuntu-drivers-common (1:0.4.19) yakkety; urgency=medium

[ Alberto Milone ]
Expand Down
10 changes: 0 additions & 10 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ Build-Depends: debhelper (>= 9),
pkg-config,
python3-xkit (>= 0.5.0),
aptdaemon,
python3-aptdaemon.pkcompat,
python3-aptdaemon.test (>= 0.43+bzr810-0ubuntu2~),
python3-gi,
gir1.2-glib-2.0,
gir1.2-packagekitglib-1.0,
gir1.2-umockdev-1.0,
umockdev,
alsa-utils,
Expand Down Expand Up @@ -54,7 +52,6 @@ Replaces: nvidia-common (<< 1:0.2.46), jockey-common, jockey-gtk, jockey-kde
Conflicts: nvidia-common (<< 1:0.2.46), jockey-common, jockey-gtk, jockey-kde
Breaks: nvidia-prime (<< 0.6)
Provides: nvidia-common, jockey-common, jockey-gtk, jockey-kde
Enhances: packagekit-system-interface
Description: Detect and install additional Ubuntu driver packages
This package aggregates and abstracts Ubuntu specific logic and knowledge
about third-party driver packages. It provides:
Expand All @@ -64,18 +61,11 @@ Description: Detect and install additional Ubuntu driver packages
.
- an "ubuntu-drivers" command line tool to list or install driver packages
(mostly for integration in installers).
.
- a PackageKit plugin for WhatProvides() for types MODALIAS and
HARDWARE_DRIVER, to do the same queries as above through the PackageKit API
(for using in non-distro specific GUIs). This works with aptdaemon's
PackageKit compatibility layer (python3-aptdaemon.pkcompat) and with
PackageKit's apt backend, but _not_ with the PackageKit aptcc backend.
.
- some NVidia specific support code to find the most appropriate driver
version, as well as setting up the alternatives symlinks that the
proprietary NVidia and FGLRX packages use.


Package: dh-modaliases
Architecture: all
Depends: ${perl:Depends},
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,4 @@
("/usr/lib/ubiquity/target-config", glob.glob("ubiquity/target-config/*")),
] + extra_data,
scripts=["nvidia-detector", "quirks-handler", "ubuntu-drivers"],
entry_points="""[packagekit.apt.plugins]
what_provides=UbuntuDrivers.PackageKit:what_provides
""",
)
Loading

0 comments on commit 373f44e

Please sign in to comment.