Unhooking the foomatic parser

There is now a proper PPDs class in the printer admin tool, capable of indexing the PPDs that CUPS returns in a variety of useful ways. This means system-config-printer no longer needs to parse the foomatic XML database when looking for a printer driver, starting from version 0.7.67.

We can index by make and model (even with some of the daft make-and-model strings from the vendor PPDs shipped with foomatic), and also by IEEE 1284 Device ID. When several drivers are capable of driving a particular device we use some simple rules to decide which to use. Previously we used the foomatic database “recommended driver”.

When CUPS 1.3 comes along with its CUPS_GET_PPD method we’ll be able to read through each candidate PPD file to look for Mike Sweet’s rating tags, and use those to decide on driver suitability.

The method for matching a Device ID to a driver also gives an indication of how good a match it found, and this will be useful for user notifications.

2 Responses to “Unhooking the foomatic parser”

  1. Jeremy Katz says:

    Does this mean that the foomatic package will be able to stop being installed by default?

  2. tim says:

    Not really. Yes, we can remove the dependency on foomatic in the system-config-printer package, but we would still want the foomatic package installed by default for the wide range of devices it can supply PPDs for. In other words, you can avoid installing foomatic, but you won’t get nearly so many PPDs in that case.

    Foomatic provides a CUPS driver script, /usr/lib/cups/driver/foomatic, which CUPS uses to fetch a list of PPDs when it needs it (on demand). So listing the available PPDs with “lpinfo -m” shows the PPDs that foomatic is capable of generating in addition to the PPDs that CUPS already has.

    We had been parsing the foomatic database in addition to this (meaning that it got parsed twice, actually), but unhooking our own parser means that we can make system-config-printer a “pure” CUPS configuration program, and that brings with it some benefits. Most notably, the “recommended driver” can now potentially include CUPS drivers, or PPDs from manufacturers, whereas before it was always the foomatic driver.

    It also means that hal-cups-utils will be able to choose the best available PPD for a given device, without being restricted to foomatic PPDs (as it is in F-7).