RHEL-25803 libppd - backport fix for PWG printer support
Resolves: RHEL-25803
This commit is contained in:
parent
18581d8692
commit
5c3e5ed08f
85
libppd-check-required-attrs.patch
Normal file
85
libppd-check-required-attrs.patch
Normal file
@ -0,0 +1,85 @@
|
||||
diff --git a/ppd/ppd-generator.c b/ppd/ppd-generator.c
|
||||
index a815030..637e7b5 100644
|
||||
--- a/ppd/ppd-generator.c
|
||||
+++ b/ppd/ppd-generator.c
|
||||
@@ -703,7 +703,8 @@ ppdCreatePPDFromIPP2(char *buffer, // I - Filename buffer
|
||||
is_pdf = 1;
|
||||
}
|
||||
#ifdef CUPS_RASTER_HAVE_APPLERASTER
|
||||
- else if (cupsArrayFind(pdl_list, "image/urf"))
|
||||
+ else if (cupsArrayFind(pdl_list, "image/urf") &&
|
||||
+ (ippFindAttribute(supported, "urf-supported", IPP_TAG_KEYWORD) != NULL))
|
||||
{
|
||||
int resStore = 0; // Variable for storing the no. of resolutions in the resolution array
|
||||
int resArray[__INT16_MAX__]; // Creating a resolution array supporting a maximum of 32767 resolutions.
|
||||
@@ -830,44 +831,38 @@ ppdCreatePPDFromIPP2(char *buffer, // I - Filename buffer
|
||||
formatfound = 1;
|
||||
is_pdf = 1;
|
||||
}
|
||||
- else if (cupsArrayFind(pdl_list, "image/pwg-raster"))
|
||||
+ else if (cupsArrayFind(pdl_list, "image/pwg-raster") &&
|
||||
+ ippFindAttribute(supported, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD) != NULL &&
|
||||
+ (attr = ippFindAttribute(supported, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL)
|
||||
{
|
||||
- if ((attr = ippFindAttribute(supported,
|
||||
- "pwg-raster-document-resolution-supported",
|
||||
- IPP_TAG_RESOLUTION)) != NULL)
|
||||
+ current_def = NULL;
|
||||
+ if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL &&
|
||||
+ cfJoinResolutionArrays(&common_res, ¤t_res, &common_def,
|
||||
+ ¤t_def))
|
||||
{
|
||||
- current_def = NULL;
|
||||
- if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL &&
|
||||
- cfJoinResolutionArrays(&common_res, ¤t_res, &common_def,
|
||||
- ¤t_def))
|
||||
- {
|
||||
- cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 0 -\"\n");
|
||||
- if (formatfound == 0) manual_copies = 1;
|
||||
- formatfound = 1;
|
||||
- is_pwg = 1;
|
||||
- }
|
||||
+ cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 0 -\"\n");
|
||||
+ if (formatfound == 0) manual_copies = 1;
|
||||
+ formatfound = 1;
|
||||
+ is_pwg = 1;
|
||||
}
|
||||
}
|
||||
- else if (cupsArrayFind(pdl_list, "application/PCLm"))
|
||||
+ else if (cupsArrayFind(pdl_list, "application/PCLm") &&
|
||||
+ (attr = ippFindAttribute(supported, "pclm-source-resolution-supported", IPP_TAG_RESOLUTION)) != NULL)
|
||||
{
|
||||
- if ((attr = ippFindAttribute(supported, "pclm-source-resolution-supported",
|
||||
- IPP_TAG_RESOLUTION)) != NULL)
|
||||
+ if ((defattr = ippFindAttribute(supported,
|
||||
+ "pclm-source-resolution-default",
|
||||
+ IPP_TAG_RESOLUTION)) != NULL)
|
||||
+ current_def = cfIPPResToResolution(defattr, 0);
|
||||
+ else
|
||||
+ current_def = NULL;
|
||||
+ if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL &&
|
||||
+ cfJoinResolutionArrays(&common_res, ¤t_res, &common_def,
|
||||
+ ¤t_def))
|
||||
{
|
||||
- if ((defattr = ippFindAttribute(supported,
|
||||
- "pclm-source-resolution-default",
|
||||
- IPP_TAG_RESOLUTION)) != NULL)
|
||||
- current_def = cfIPPResToResolution(defattr, 0);
|
||||
- else
|
||||
- current_def = NULL;
|
||||
- if ((current_res = cfIPPAttrToResolutionArray(attr)) != NULL &&
|
||||
- cfJoinResolutionArrays(&common_res, ¤t_res, &common_def,
|
||||
- ¤t_def))
|
||||
- {
|
||||
- cupsFilePuts(fp, "*cupsFilter2: \"application/PCLm application/PCLm 0 -\"\n");
|
||||
- if (formatfound == 0) manual_copies = 1;
|
||||
- formatfound = 1;
|
||||
- is_pclm = 1;
|
||||
- }
|
||||
+ cupsFilePuts(fp, "*cupsFilter2: \"application/PCLm application/PCLm 0 -\"\n");
|
||||
+ if (formatfound == 0) manual_copies = 1;
|
||||
+ formatfound = 1;
|
||||
+ is_pclm = 1;
|
||||
}
|
||||
}
|
||||
// Legacy formats only if we have no driverless format
|
||||
@ -6,7 +6,7 @@
|
||||
Name: libppd
|
||||
Epoch: 1
|
||||
Version: 2.0.0
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
Summary: Library for retro-fitting legacy printer drivers
|
||||
|
||||
# the CUPS exception text is the same as LLVM exception, so using that name with
|
||||
@ -18,6 +18,10 @@ Source0: %{URL}/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
|
||||
# Patches
|
||||
# https://github.com/OpenPrinting/libppd/commit/c7a62e8c4c3
|
||||
# https://github.com/OpenPrinting/libppd/commit/81e708f5a
|
||||
# https://github.com/OpenPrinting/libppd/commit/42ce356e8972
|
||||
Patch001: libppd-check-required-attrs.patch
|
||||
|
||||
|
||||
# for autogen.sh
|
||||
@ -190,6 +194,9 @@ rm -rf %{buildroot}%{_datadir}/ppdc
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Jul 17 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-5
|
||||
- RHEL-25803 libppd - backport fix for PWG printer support
|
||||
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:2.0.0-4
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user