Removed broken cups-get-classes patch (bug #870612).

Resolves: rhbz#870612
This commit is contained in:
Tim Waugh 2012-10-29 11:44:35 +00:00
parent aa4234a61a
commit 1d34f84c93
2 changed files with 4 additions and 93 deletions

View File

@ -1,89 +0,0 @@
diff -up cups-1.5.0/cups/dest.c.cups-get-classes cups-1.5.0/cups/dest.c
--- cups-1.5.0/cups/dest.c.cups-get-classes 2011-05-20 04:49:49.000000000 +0100
+++ cups-1.5.0/cups/dest.c 2011-09-14 12:10:05.111635428 +0100
@@ -534,6 +534,7 @@ _cupsGetDests(http_t *http, /* I -
char uri[1024]; /* printer-uri value */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
+ int get_classes; /* Whether we need to fetch class */
#ifdef __APPLE__
char media_default[41]; /* Default paper size */
#endif /* __APPLE__ */
@@ -590,6 +591,8 @@ _cupsGetDests(http_t *http, /* I -
* printer-uri [for IPP_GET_PRINTER_ATTRIBUTES]
*/
+ get_classes = (op == CUPS_GET_PRINTERS);
+
request = ippNewRequest(op);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
@@ -647,6 +650,23 @@ _cupsGetDests(http_t *http, /* I -
attr->value_tag != IPP_TAG_URI)
continue;
+ if (get_classes &&
+
+ /* Is this a class? */
+ ((attr->value_tag == IPP_TAG_ENUM &&
+ !strcmp(attr->name, "printer-type") &&
+ (attr->values[0].integer & CUPS_PRINTER_CLASS)) ||
+
+ /* Or, is this an attribute from CUPS 1.2 or later? */
+ !strcmp(attr->name, "auth-info-required") ||
+ !strncmp(attr->name, "marker-", 7) ||
+ !strcmp(attr->name, "printer-commands") ||
+ !strcmp(attr->name, "printer-is-shared")))
+ /* We are talking to a recent enough CUPS server that
+ * CUPS_GET_PRINTERS returns classes as well.
+ */
+ get_classes = 0;
+
if (!strcmp(attr->name, "auth-info-required") ||
!strcmp(attr->name, "device-uri") ||
!strcmp(attr->name, "marker-change-time") ||
@@ -738,6 +758,28 @@ _cupsGetDests(http_t *http, /* I -
continue;
}
+ /*
+ * If we sent a CUPS_GET_CLASSES request, check whether
+ * CUPS_GET_PRINTERS already gave us this destination and exit
+ * early if so.
+ */
+
+ if (op == CUPS_GET_CLASSES && num_dests > 0)
+ {
+ int diff;
+ cups_find_dest (printer_name, NULL, num_dests, *dests, 0, &diff);
+ if (diff == 0)
+ {
+ /*
+ * Found it. The CUPS server already gave us the classes in
+ * its CUPS_GET_PRINTERS response.
+ */
+
+ cupsFreeOptions(num_options, options);
+ break;
+ }
+ }
+
if ((dest = cups_add_dest(printer_name, NULL, &num_dests, dests)) != NULL)
{
dest->num_options = num_options;
@@ -754,6 +796,15 @@ _cupsGetDests(http_t *http, /* I -
}
/*
+ * If this is a CUPS_GET_PRINTERS request but we didn't see any
+ * classes we might be talking to an older CUPS server that requires
+ * CUPS_GET_CLASSES as well.
+ */
+
+ if (get_classes)
+ num_dests = _cupsGetDests (http, CUPS_GET_CLASSES, name, dests, 0, 0);
+
+ /*
* Return the count...
*/

View File

@ -10,7 +10,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.6.1
Release: 6%{?dist}
Release: 7%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@ -46,7 +46,6 @@ Patch17: cups-usb-paperout.patch
Patch19: cups-res_init.patch
Patch20: cups-filter-debug.patch
Patch21: cups-uri-compat.patch
Patch22: cups-cups-get-classes.patch
Patch23: cups-str3382.patch
Patch24: cups-usblp-quirks.patch
Patch25: cups-0755.patch
@ -229,8 +228,6 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
%patch20 -p1 -b .filter-debug
# Allow the usb backend to understand old-style URI formats.
%patch21 -p1 -b .uri-compat
# Fix support for older CUPS servers in cupsGetDests.
%patch22 -p1 -b .cups-get-classes
# Fix temporary filename creation.
%patch23 -p1 -b .str3382
# Problem is a port reset which is done by the new USB backend of CUPS 1.5.4 and 1.6.x to clean up after the job.
@ -579,6 +576,9 @@ rm -f %{cups_serverbin}/backend/smb
%{_mandir}/man1/ipptool.1.gz
%changelog
* Mon Oct 29 2012 Tim Waugh <twaugh@redhat.com> 1:1.6.1-7
- Removed broken cups-get-classes patch (bug #870612).
* Mon Oct 22 2012 Jiri Popelka <jpopelka@redhat.com> 1:1.6.1-6
- Add quirk rule for Xerox Phaser 3124 (#867392)
- backport more quirk rules (STR #4191)