[Pkg-cups-devel] cups reactivate_recommended_driver.dpatch

Till Kamppeter till.kamppeter at gmail.com
Mon Sep 8 08:20:15 UTC 2008


Martin Pitt wrote:
> Hi Till,
> 
> Our cups packages have been carrying
> reactivate_recommended_driver.dpatch for a while (attached for
> reference). gnome-cups-manager had used this tag, but it has been
> removed from both Debian and Ubuntu, and is not maintained upstream
> any more. cups upstream deliberately removed the tag and apparently
> isn't willing to put it back.
> 
> system-config-printer does not seem to use it either, it just filters
> it out and instead seems to have its own method of finding out the
> recommended one.
> 
> Can you please clarify the situation? Should we still carry the patch
> and keep the "(recommended)" suffix, or can we drop it? If the former,
> and other distros have it as well, maybe you can open a new STR and
> explain the issue again, pointing out the reasons why we still need
> it?
> 
> Thank you!
> 
> Martin,
> who is cleaning up all the cups patches and forwards them upstream
> 

Hi,

the "(recommended)" tags are actually used by system-config-printer. See 
the /usr/share/python-support/python-cupshelpers/cupshelpers/ppds.py 
file, the part beginning at line 164 (see also below). Driver tagged 
"(recommended)" get a lower score and therefore higher priority. There 
are also many other criteria, as the tags are only used by the Foomatic 
database, but there are also many PPDs being part of driver packages.

Foomatic is already prepared for a more sophisticated driver 
recommendation system. Drivers can get numerical ratings by document 
type, both the driver in general but also specific printer/driver 
combos. Driver entries have also info about whether they are free 
software, from the manufacturer, with patent issues, ... So more 
sophisticated, user-configurable filtering and prioritizing is possible. 
Only problem is that the database is not fully populated with this 
information and also the information is not available with non-Foomatic 
PPDs.

    Till

------------------------------------------------------------------------

# Some drivers are just generally better than others.
# Here is the preference list:
DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT = 8
DRIVER_TYPE_VENDOR = 10
DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT = 15
DRIVER_TYPE_FOOMATIC_HPIJS_ON_HP = 17
DRIVER_TYPE_GUTENPRINT_NATIVE_SIMPLIFIED = 20
DRIVER_TYPE_GUTENPRINT_NATIVE = 25
DRIVER_TYPE_SPLIX = 27
DRIVER_TYPE_FOOMATIC_PS = 30
DRIVER_TYPE_FOOMATIC_HPIJS = 40
DRIVER_TYPE_FOOMATIC_GUTENPRINT_SIMPLIFIED = 50
DRIVER_TYPE_FOOMATIC_GUTENPRINT = 60
DRIVER_TYPE_FOOMATIC = 70
DRIVER_TYPE_CUPS = 80
DRIVER_TYPE_FOOMATIC_GENERIC = 90
DRIVER_DOES_NOT_WORK = 999
def _getDriverType (ppdname, ppds=None):
     """Decides which of the above types ppdname is."""
     if ppdname.find ("gutenprint") != -1:
         if (ppdname.find ("/simple/") != -1 or
             ppdname.find (".sim-") != -1):
             return DRIVER_TYPE_GUTENPRINT_NATIVE_SIMPLIFIED
         else:
             return DRIVER_TYPE_GUTENPRINT_NATIVE
     if ppdname.find ("splix")!= -1:
         return DRIVER_TYPE_SPLIX
     if (ppdname.find (":") == -1 and
         ppdname.find ("/cups-included/") != -1):
         return DRIVER_TYPE_CUPS
     if ppdname.startswith ("foomatic:"):
         # Foomatic (generated) -- but which driver?
         if ppdname.find ("Generic")!= -1:
             return DRIVER_TYPE_FOOMATIC_GENERIC
         if (ppds != None and
             ppds.getInfoFromPPDName (ppdname).\
             get ('ppd-make-and-model', '').find ("(recommended)") != -1):
             if ppds.getInfoFromPPDName (ppdname).\
                get ('ppd-make-and-model', '').find ("Postscript") != -1:
                 return DRIVER_TYPE_FOOMATIC_RECOMMENDED_POSTSCRIPT
             else:
                 return DRIVER_TYPE_FOOMATIC_RECOMMENDED_NON_POSTSCRIPT
         if ppdname.find ("-Postscript")!= -1:
             return DRIVER_TYPE_FOOMATIC_PS
         if ppdname.find ("-hpijs") != -1:
             if ppdname.find ("hpijs-rss") == -1:
                 return DRIVER_TYPE_FOOMATIC_HPIJS
         if ppdname.find ("-gutenprint") != -1:
             if ppdname.find ("-simplified")!= -1:
                 return DRIVER_TYPE_FOOMATIC_GUTENPRINT_SIMPLIFIED
             return DRIVER_TYPE_FOOMATIC_GUTENPRINT
         return DRIVER_TYPE_FOOMATIC
     if ppdname.find ("-hpijs") != -1:
         if ppdname.find ("hpijs-rss") == -1:
             return DRIVER_TYPE_FOOMATIC_HPIJS
     # Anything else should be a vendor's PPD.
     return DRIVER_TYPE_VENDOR # vendor's own




More information about the Pkg-cups-devel mailing list