udev-ish replacement for hal-cups-utils?

Martin Pitt martin.pitt at ubuntu.com
Thu Jun 4 09:33:45 PDT 2009

Hello Tim,

Tim Waugh [2009-06-04 16:25 +0100]:
> The hal backend is not really used any more.

Ah, good to know.

> The important part of hal-cups-utils is the HAL addon/callout,
> hal_lpadmin.  We need to be able to trigger print queue
> addition/removal when a printer is connected/disconnected.

This should be possible with a rule like

---------------- 8< ---------------
ENV{DEVTYPE}!="usb_device", GOTO="libgphoto2_rules_end"

ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"

ENV{ID_USB_INTERFACES}=="*:07*:*", ACTION=="add", RUN+="cups_admin --add %p"
ENV{ID_USB_INTERFACES}=="*:07*:*", ACTION=="remove", RUN+="cups_admin --remove %p"

---------------- 8< ---------------

> Instead of using a generic backend, we need to decide which of the
> available CUPS devices is the correct one for the queue and use that.
> This is similar to what hal_lpadmin currently does. (It only uses the
> 'hal' backend if it fails to discover which device is the correct one to
> use.)

I see. So we can basically keep the structure of hal_lpadmin to become
cups_admin (except that this should fork into the background to avoid
stalling udev processing), and just replace the hal specific
information retrieval with some libudev calls to get the properties
from udev?

The current hal_lpadmin writes stuff into the hal db. Doing something
like that with cups_admin is possible, but not quite in the same way
(you need to have the callout write key=value properties to stdout and
import them with "IMPORT{program}"). Is that actually necessary,



Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/devkit-devel/attachments/20090604/bf6d13dc/attachment.pgp 

More information about the devkit-devel mailing list