]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Made driverless PPD generator more reliable for print or fax PPD
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 10 Mar 2021 19:27:45 +0000 (20:27 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 10 Mar 2021 19:29:43 +0000 (20:29 +0100)
(cherry picked from commit d7b22d732912bdc971b04d31a89083a9bce06657)

NEWS
cupsfilters/ppdgenerator.c

diff --git a/NEWS b/NEWS
index d246eb1143096370c4a4806a34e607a139196147..d4e03defeb6fbd0e00e234f3218b94621461fcee 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ NEWS - OpenPrinting CUPS Filters v1.28.7 - 2021-01-07
 
 CHANGES IN V1.28.8
 
+       - libcupsfilters: Made check whether the driverless PPD to
+         generate should be a fax out PPD more reliable (Issue #343).
        - foomatic-rip: Options in the 5th command line argument of
          the CUPS filter command line are separated only by white
          space and not by comma, also make sure that an option "none"
index ebc2ee1c08c137a9ddd0a2958f49554004faf574..7b37a9e7444761e7031bbee3a10d1571cc637462 100644 (file)
@@ -1678,9 +1678,18 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
   cupsFilePuts(fp, "*PCFileName: \"drvless.ppd\"\n");
 
   if ((attr = ippFindAttribute(response, "ipp-features-supported",
-                              IPP_TAG_KEYWORD))!= NULL &&
+                              IPP_TAG_KEYWORD)) != NULL &&
       ippContainsString(attr, "faxout"))
-    is_fax = 1;
+  {
+    attr = ippFindAttribute(response, "printer-uri-supported",
+                           IPP_TAG_URI);
+    if (attr)
+    {
+      ippAttributeString(attr, buf, sizeof(buf));
+      if (strcasestr(buf, "faxout"))
+       is_fax = 1;
+    }
+  }
 
   if ((attr = ippFindAttribute(response, "printer-make-and-model",
                               IPP_TAG_TEXT)) != NULL)
@@ -4220,12 +4229,13 @@ ppdCreateFromIPP2(char         *buffer,          /* I - Filename buffer */
   free(max_res);
 
   snprintf(ppdgenerator_msg, sizeof(ppdgenerator_msg),
-          "%s PPD generated.",
-          (is_pdf ? "PDF" :
+          "%s %sPPD generated.",
+          (is_apple ? "Apple Raster" :
            (is_pwg ? "PWG Raster" :
-            (is_apple ? "Apple Raster" :
+            (is_pdf ? "PDF" :
              (is_pclm ? "PCLm" :
-              "Legacy IPP printer")))));
+              "Legacy IPP printer")))),
+          (is_fax ? "Fax " : ""));
 
   cupsFileClose(fp);
   if (printer_opt_strings_catalog)