Bug 456906 - s-c-p should use PackageKit to install PPDs
s-c-p should use PackageKit to install PPDs
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: system-config-printer (Show other bugs)
12
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Triaged
: 497440 (view as bug list)
Depends On: 438225 461234 538101 539615 539620 558450
Blocks: F13Target 547837
  Show dependency treegraph
 
Reported: 2008-07-28 11:34 EDT by Bastien Nocera
Modified: 2010-02-15 07:14 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-02-15 07:14:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
postscriptdriver.prov (7.64 KB, text/plain)
2009-08-25 09:51 EDT, Tim Waugh
no flags Details
rpm-postscriptdriver.patch (1.96 KB, patch)
2009-08-25 09:52 EDT, Tim Waugh
no flags Details | Diff
postscriptdriver.prov (7.47 KB, text/plain)
2009-11-23 11:00 EST, Tim Waugh
no flags Details

  None (edit)
Description Bastien Nocera 2008-07-28 11:34:50 EDT
system-config-printer could use PackageKit to request installation of new PPDs.

PPDs could advertise which printers they support through the RPM provides,
similarly to what gstreamer plugins, and .desktop files would (see bug 438225).
Comment 1 Till Kamppeter 2008-07-28 12:02:47 EDT
Problem is that a typical distribution contains more or less as many PPD files
(both physically present and available via PPD generator in
/usr/lib/cups/driver/) as it contains packages. So if all packages which contain
or generate PPDs have the device ID of each printer which they support in their
RPM provides, there would be more or less one half of the output lines of "rpm
-qa" entries for printers.

In general it would be nice if printer drivers can be installed with something
like (simplified)

yum install `usb_printerid /dev/usb/lp0`

but package list would get cluttered a lot.
Comment 2 Tim Waugh 2008-07-28 12:13:38 EDT
Interesting idea.  Not entirely sure how it would work for printer drivers;
perhaps something like this:

Provides: PPD(MFG:EPSON;MDL:EPSON Stylus CX3100;)

Till: actually these 'provides' tags are not treated as packages for the
purposes of 'rpm -qa' or the like.  For instance, in Fedora 9 the xulrunner
package provides 'gecko-libs', but this is not listed in the 'rpm -qa' output. 
Similarly for the implicit library dependencies such as 'libz.so.1()(64bit)'.
Comment 3 Bastien Nocera 2008-07-28 12:20:07 EDT
(In reply to comment #1)
> Problem is that a typical distribution contains more or less as many PPD files
> (both physically present and available via PPD generator in
> /usr/lib/cups/driver/) as it contains packages. So if all packages which contain
> or generate PPDs have the device ID of each printer which they support in their
> RPM provides, there would be more or less one half of the output lines of "rpm
> -qa" entries for printers.

Huh? Who's talking about splitting each PPD file into a separate package? I'm
talking about using the RPM provides to advertise which PPD files the package
contains.

"rpm -q --provides package-name" would list 

> In general it would be nice if printer drivers can be installed with something
> like (simplified)
> 
> yum install `usb_printerid /dev/usb/lp0`
> 
> but package list would get cluttered a lot.

Except that yum would look in both the package names, and the provides that
those packages have. Just like a single library package can provide more than
one library provides (see output of "rpm -q --provides glibc".

So the above would actually be possible without cluttering the package list.

(In reply to comment #2)
> Interesting idea.  Not entirely sure how it would work for printer drivers;
> perhaps something like this:
> 
> Provides: PPD(MFG:EPSON;MDL:EPSON Stylus CX3100;)

You'd need a bit of code to marshal and de-marshal the IEEE1284 ID for the
printer/PPD names.
Comment 4 Tim Waugh 2008-07-28 12:26:53 EDT
(In reply to comment #3)
> > Provides: PPD(MFG:EPSON;MDL:EPSON Stylus CX3100;)
> 
> You'd need a bit of code to marshal and de-marshal the IEEE1284 ID for the
> printer/PPD names.

Yes, this isn't particularly hard.  PPD files should have '*1284DeviceID'
attributes containing this information, and if they don't we just don't add a
'provides' symbol for that PPD.

More tricky would be having a generic script for RPM to determine which PPDs are
shipped in a package.  It isn't just a case of looking for *.ppd files, as in
many cases the PPSs are generated from CUPS drivers; however, they *are* easy to
spot, and have a known API.

Would be time-consuming at package build time to generate each PPD and look for
IEEE 1284 ID strings, but this would *really* pay off if we could demand-install
drivers based on those ID strings.
Comment 5 Tim Waugh 2008-08-27 05:07:41 EDT
There will need to be a different D-Bus API between hal-cups-utils and system-config-printer-applet, as hal-cups-utils will now have to ask for packages to be installed before it can look for PPDs.

Interestingly, someone from Mandriva sent me a patch to add a similar interface for installing the cups package at that stage, which is along similar lines.
Comment 6 Bug Zapper 2008-11-25 21:36:28 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Jon Stanley 2008-11-26 14:13:31 EST
Fixing version to align with rawhide again.  Sorry for the noise.
Comment 8 Bastien Nocera 2009-02-10 18:33:44 EST
(In reply to comment #5)
> There will need to be a different D-Bus API between hal-cups-utils and
> system-config-printer-applet, as hal-cups-utils will now have to ask for
> packages to be installed before it can look for PPDs.

What packages would you need to install before you install the necessary PPDs? Is this for printers that need additional packages to be accessed _before_ we can get their advertise IEEE1284 ID?

> Interestingly, someone from Mandriva sent me a patch to add a similar interface
> for installing the cups package at that stage, which is along similar lines.

CUPS itself? I thought that was a hard-dependency for the desktop nowadays.
Comment 10 Tim Waugh 2009-06-10 07:34:34 EDT
*** Bug 497440 has been marked as a duplicate of this bug. ***
Comment 11 Tim Waugh 2009-08-10 17:22:52 EDT
This is a bit harder than first thought:

1. foomatic is just a nightmare.  It doesn't depend on all the tiny little drivers and scripts it knows about, so it doesn't really help to add tags to it anyway.  Best to ignore it I think, and concentrate on the CUPS native drivers.

2. Some drivers are now shipped in the form of cupsddk-based 'drv' files and we don't have a good way to fetch PPDs from those without cupsd running.
Comment 12 Tim Waugh 2009-08-25 09:50:58 EDT
Some progress made.  I've created an RPM provides script that can extract makes and model names from the three available CUPS driver types:

i.   Plain PPD files
ii.  Dynamic drivers (/usr/lib/cups/driver/*)
iii. DDK drivers (/usr/share/cups/drv/*.drv)

It is checked into the system-config-printer git repository as postscriptdriver.prov.

Provides tags are generated in the format "postscriptdriver($MFG;$MDL;)", where $MFG and $MDL are the manufacturer and model names of the supported device, with some processing performed on them:

* they are converted to lower case
* parentheses "()" and spaces " " are translated to underscores "_"
Comment 13 Tim Waugh 2009-08-25 09:51:37 EDT
Created attachment 358575 [details]
postscriptdriver.prov

RPM provides script.
Comment 14 Tim Waugh 2009-08-25 09:52:38 EDT
Created attachment 358576 [details]
rpm-postscriptdriver.patch

Patch for rpm-4.7.1 to get it to use it in the internal dependency generator.
Comment 15 Tim Waugh 2009-10-19 05:05:09 EDT
Requires feature page.
Comment 17 Bug Zapper 2009-11-16 03:10:10 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 18 Tim Waugh 2009-11-23 11:00:13 EST
Created attachment 373158 [details]
postscriptdriver.prov

New version of postscriptdriver.prov which doesn't replacement spaces or parentheses.

Note You need to log in before you can comment on or make changes to this bug.