]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
lpoptions now works with discovered but un-added printers (Issue #5045)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 6 Dec 2018 16:24:49 +0000 (11:24 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 6 Dec 2018 16:24:49 +0000 (11:24 -0500)
CHANGES.md
systemv/lpoptions.c

index 3c2a1c7e99f89f500eaee62b23623739b2438ea8..b5aff7158022f6b3b7bb214dcdc5f96da99e7130 100644 (file)
@@ -1,10 +1,12 @@
-CHANGES - 2.2.10 - 2018-12-05
+CHANGES - 2.2.10 - 2018-12-06
 =============================
 
 
 Changes in CUPS v2.2.10
 -----------------------
 
+- The `lpoptions` command now works with IPP Everywhere printers that have not
+  yet been added as local queues (Issue #5045)
 - Added USB quirk rules (Issue #5395, Issue #5443)
 - The generated PPD files for IPP Everywhere printers did not contain the
   cupsManualCopies keyword (Issue #5433)
index fceab6d8ee72f86eab8c09198e8ec49ad8bbde41..5926dc2a083bb7d19c550dffe006c226bcbde23f 100644 (file)
@@ -480,19 +480,32 @@ list_group(ppd_file_t  *ppd,              /* I - PPD file */
 static void
 list_options(cups_dest_t *dest)                /* I - Destination to list */
 {
+  http_t       *http;                  /* Connection to destination */
+  char         resource[1024];         /* Resource path */
   int          i;                      /* Looping var */
   const char   *filename;              /* PPD filename */
   ppd_file_t   *ppd;                   /* PPD data */
   ppd_group_t  *group;                 /* Current group */
 
 
-  if ((filename = cupsGetPPD(dest->name)) == NULL)
+  if ((http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE, 30000, NULL, resource, sizeof(resource), NULL, NULL)) == NULL)
   {
     _cupsLangPrintf(stderr, _("lpoptions: Unable to get PPD file for %s: %s"),
                    dest->name, cupsLastErrorString());
     return;
   }
 
+  if ((filename = cupsGetPPD2(http, dest->name)) == NULL)
+  {
+    httpClose(http);
+
+    _cupsLangPrintf(stderr, _("lpoptions: Unable to get PPD file for %s: %s"),
+                   dest->name, cupsLastErrorString());
+    return;
+  }
+
+  httpClose(http);
+
   if ((ppd = ppdOpenFile(filename)) == NULL)
   {
     unlink(filename);