- Updated pycups to 1.9.45.

This commit is contained in:
Tim Waugh 2009-01-08 18:04:56 +00:00
parent e2a7d93d16
commit c2273c9cee
6 changed files with 7 additions and 121 deletions

View File

@ -192,3 +192,4 @@ pycups-1.9.44.tar.bz2
system-config-printer-1.0.12.tar.bz2 system-config-printer-1.0.12.tar.bz2
system-config-printer-1.1.0.tar.bz2 system-config-printer-1.1.0.tar.bz2
system-config-printer-1.1.1.tar.bz2 system-config-printer-1.1.1.tar.bz2
pycups-1.9.45.tar.bz2

Binary file not shown.

BIN
pycups-1.9.45.tar.bz2.sig Normal file

Binary file not shown.

View File

@ -1,113 +0,0 @@
diff -U0 pycups-1.9.44/ChangeLog.pycups-git pycups-1.9.44/ChangeLog
--- pycups-1.9.44/ChangeLog.pycups-git 2008-11-28 12:27:15.000000000 +0000
+++ pycups-1.9.44/ChangeLog 2008-12-17 16:36:03.000000000 +0000
@@ -0,0 +1,16 @@
+2008-12-17 Tim Waugh <twaugh@redhat.com>
+
+ * cupsconnection.c (Connection_printTestPage): Look for
+ "testprint" as well as "testprint.ps", as that is the name of the
+ test page file in CUPS 1.4 (bug #476612).
+
+2008-12-17 Tim Waugh <twaugh@redhat.com>
+
+ * cupsconnection.c (Connection_printTestPage): Only set a
+ document-format attribute if one is specified.
+
+2008-12-17 Tim Waugh <twaugh@redhat.com>
+
+ * cupsconnection.c (Connection_printTestPage): Avoid crash when
+ given bad parameters.
+
diff -up pycups-1.9.44/cupsconnection.c.pycups-git pycups-1.9.44/cupsconnection.c
--- pycups-1.9.44/cupsconnection.c.pycups-git 2008-11-25 12:12:38.000000000 +0000
+++ pycups-1.9.44/cupsconnection.c 2008-12-17 16:36:03.000000000 +0000
@@ -2908,13 +2908,13 @@ Connection_printTestPage (Connection *se
PyObject *printerobj;
char *printer;
PyObject *fileobj = NULL;
- char *file;
+ char *file = NULL;
PyObject *titleobj = NULL;
- char *title;
+ char *title = NULL;
PyObject *formatobj = NULL;
- char *format;
+ char *format = NULL;
PyObject *userobj = NULL;
- char *user;
+ char *user = NULL;
const char *datadir;
char filename[PATH_MAX];
char uri[HTTP_MAX_URI];
@@ -2946,17 +2946,33 @@ Connection_printTestPage (Connection *se
}
if (!fileobj) {
- const char *testprint = "%s/data/testprint.ps";
- if ((datadir = getenv ("CUPS_DATADIR")) != NULL)
- snprintf (filename, sizeof (filename), testprint, datadir);
- else {
+ const char *testprint[] = { "%s/data/testprint",
+ "%s/data/testprint.ps",
+ NULL };
+ if ((datadir = getenv ("CUPS_DATADIR")) != NULL) {
+ const char **pattern;
+ for (pattern = testprint; *pattern != NULL; pattern++) {
+ snprintf (filename, sizeof (filename), *pattern, datadir);
+ if (access (filename, R_OK) == 0)
+ break;
+ }
+ } else {
const char *const dirs[] = { "/usr/share/cups",
"/usr/local/share/cups",
NULL };
+ int found = 0;
int i;
for (i = 0; (datadir = dirs[i]) != NULL; i++) {
- snprintf (filename, sizeof (filename), testprint, datadir);
- if (access (filename, R_OK) == 0)
+ const char **pattern;
+ for (pattern = testprint; *pattern != NULL; pattern++) {
+ snprintf (filename, sizeof (filename), *pattern, datadir);
+ if (access (filename, R_OK) == 0) {
+ found = 1;
+ break;
+ }
+ }
+
+ if (found)
break;
}
@@ -2966,7 +2982,7 @@ Connection_printTestPage (Connection *se
* client-error-not-found, but we'll let that happen rather
* than raising an exception so as to be consistent with the
* case where CUPS_DATADIR is set and we trust it. */
- snprintf (filename, sizeof (filename), testprint, dirs[0]);
+ snprintf (filename, sizeof (filename), testprint[0], dirs[0]);
}
file = filename;
@@ -2975,9 +2991,6 @@ Connection_printTestPage (Connection *se
if (!titleobj)
title = "Test Page";
- if (!formatobj)
- format = "application/postscript";
-
if (!userobj)
user = (char *) cupsUser();
@@ -2991,8 +3004,10 @@ Connection_printTestPage (Connection *se
"requesting-user-name", NULL, user);
ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
NULL, title);
- ippAddString (request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
- NULL, format);
+ if (format)
+ ippAddString (request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
+ NULL, format);
+
Connection_begin_allow_threads (self);
answer = cupsDoFileRequest (self->http, request, resource, file);
Connection_end_allow_threads (self);

View File

@ -1,3 +1,3 @@
ac8f98a40b0fc4b6ab4470f10489887a pysmbc-1.0.6.tar.bz2 ac8f98a40b0fc4b6ab4470f10489887a pysmbc-1.0.6.tar.bz2
181f413546676e098352860e3ce57465 pycups-1.9.44.tar.bz2
95ad721f3d274557144ddcf5e458a9e4 system-config-printer-1.1.1.tar.bz2 95ad721f3d274557144ddcf5e458a9e4 system-config-printer-1.1.1.tar.bz2
ff634a6751f8a859ed26751bf03abef0 pycups-1.9.45.tar.bz2

View File

@ -1,4 +1,4 @@
%define pycups_version 1.9.44 %define pycups_version 1.9.45
%define pysmbc_version 1.0.6 %define pysmbc_version 1.0.6
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
@ -7,7 +7,7 @@
Summary: A printer administration tool Summary: A printer administration tool
Name: system-config-printer Name: system-config-printer
Version: 1.1.1 Version: 1.1.1
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/ URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base Group: System Environment/Base
@ -15,8 +15,6 @@ Source0: http://cyberelk.net/tim/data/system-config-printer/1.1/system-config-pr
Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
Patch10: pycups-git.patch
BuildRequires: cups-devel >= 1.2 BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4 BuildRequires: python-devel >= 2.4
BuildRequires: libsmbclient-devel >= 3.2 BuildRequires: libsmbclient-devel >= 3.2
@ -62,9 +60,6 @@ the configuration tool.
%prep %prep
%setup -q -a 1 -a 2 %setup -q -a 1 -a 2
pushd pycups-%{pycups_version}
%patch10 -p1 -b .pycups-git
popd
%build %build
%configure %configure
@ -164,6 +159,9 @@ rm -rf %buildroot
exit 0 exit 0
%changelog %changelog
* Thu Jan 8 2009 Tim Waugh <twaugh@redhat.com> 1.1.1-2
- Updated pycups to 1.9.45.
* Sat Dec 20 2008 Tim Waugh <twaugh@redhat.com> 1.1.1-1 * Sat Dec 20 2008 Tim Waugh <twaugh@redhat.com> 1.1.1-1
- 1.1.1. - 1.1.1.