diff --git a/cups-ipptool-mdns-uri.patch b/cups-ipptool-mdns-uri.patch index 6919e96..04f8ded 100644 --- a/cups-ipptool-mdns-uri.patch +++ b/cups-ipptool-mdns-uri.patch @@ -1,43 +1,39 @@ diff --git a/cups/ipp-vars.c b/cups/ipp-vars.c -index 395b0eb..60aa991 100644 +index 395b0eb..d863287 100644 --- a/cups/ipp-vars.c +++ b/cups/ipp-vars.c -@@ -13,6 +13,7 @@ +@@ -12,7 +12,7 @@ + * Include necessary headers... */ - #include -+#include +-#include ++#include "cups/cups-private.h" #include "ipp-private.h" #include "string-private.h" #include "debug-internal.h" -@@ -221,9 +222,29 @@ _ippVarsSet(_ipp_vars_t *v, /* I - IPP variables */ +@@ -220,10 +220,22 @@ _ippVarsSet(_ipp_vars_t *v, /* I - IPP variables */ + { if (!strcmp(name, "uri")) { - char uri[1024]; /* New printer URI */ -+ char resolved[1024]; /* Resolved mDNS URI */ -+ char value_uri[1024]; /* URI from value */ - http_uri_status_t uri_status; /* URI status */ +- char uri[1024]; /* New printer URI */ +- http_uri_status_t uri_status; /* URI status */ ++ char uri[1024]; /* New printer URI */ ++ char resolved[1024]; /* Resolved mDNS URI */ - if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK) -+ snprintf(value_uri, sizeof(value_uri), "%s", value); -+ value_uri[1023] = '\0'; -+ -+ if (strstr(value_uri, "._tcp")) ++ if (strstr(value, "._tcp")) + { + /* + * Resolve URI... + */ + -+ if (!_httpResolveURI(value_uri, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL)) -+ { ++ if (!_httpResolveURI(value, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL)) + return (0); -+ } + -+ snprintf(value_uri, sizeof(value_uri), "%s", resolved); -+ value_uri[1023] = '\0'; ++ value = resolved; + } + -+ if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value_uri, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK) ++ if (httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource)) < HTTP_URI_STATUS_OK) return (0); if (v->username[0]) diff --git a/cups-prioritize-print-color-mode.patch b/cups-prioritize-print-color-mode.patch index feb7119..37a1e5a 100644 --- a/cups-prioritize-print-color-mode.patch +++ b/cups-prioritize-print-color-mode.patch @@ -1,15 +1,16 @@ diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c -index 5965e38..94a125a 100644 +index 167e1df..6c05735 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c -@@ -3735,8 +3735,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ - */ +@@ -3790,6 +3790,11 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ + PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8) - if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) == NULL) -- if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL) -- if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL) -+ if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL) -+ if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL) - attr = ippFindAttribute(response, "output-mode-supported", IPP_TAG_KEYWORD); - - if (attr) + default_color = "RGB"; ++ ++ // Apparently some printers only advertise color support, so make sure ++ // we also do grayscale for these printers... ++ if (!ippContainsString(attr, "sgray_8") && !ippContainsString(attr, "black_1") && !ippContainsString(attr, "black_8")) ++ PRINTF_COLOROPTION("Gray", _("GrayScale"), CUPS_CSPACE_SW, 8) + } + else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48") || !strcmp(keyword, "ADOBERGB24-48")) + { diff --git a/cups.spec b/cups.spec index adb5af0..b03e622 100644 --- a/cups.spec +++ b/cups.spec @@ -15,7 +15,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 2.3.3 -Release: 15%{?dist} +Release: 16%{?dist} License: ASL 2.0 Url: http://www.cups.org/ Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz @@ -765,6 +765,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man7/ippevepcl.7.gz %changelog +* Mon Nov 02 2020 Zdenek Dohnal - 1:2.3.3-16 +- backport cups-ipptool-mdns-uri.patch from upstream +- backport cups-prioritize-print-color-mode.patch from upstream + * Thu Sep 03 2020 Zdenek Dohnal - 1:2.3.3-14 - revert previous commit - resolved doesn't work with avahi due missing link in NetworkManager