From 4a1969277f3cf9e4280c249d6c5e32afd8974482 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 17 Dec 2007 12:42:56 +0000 Subject: [PATCH] - Updated pycups to 1.9.32. --- .cvsignore | 1 + pycups-1.9.31.tar.bz2.sig | Bin 65 -> 0 bytes pycups-1.9.32.tar.bz2.sig | Bin 0 -> 65 bytes pycups-attributes-uri.patch | 136 ------------------------------------ pycups-job-sheets.patch | 21 ------ sources | 2 +- system-config-printer.spec | 11 ++- 7 files changed, 6 insertions(+), 165 deletions(-) delete mode 100644 pycups-1.9.31.tar.bz2.sig create mode 100644 pycups-1.9.32.tar.bz2.sig delete mode 100644 pycups-attributes-uri.patch delete mode 100644 pycups-job-sheets.patch diff --git a/.cvsignore b/.cvsignore index 81c532b..1f828ff 100644 --- a/.cvsignore +++ b/.cvsignore @@ -148,3 +148,4 @@ pycups-1.9.29.tar.bz2 pycups-1.9.30.tar.bz2 pycups-1.9.31.tar.bz2 system-config-printer-0.7.78.tar.bz2 +pycups-1.9.32.tar.bz2 diff --git a/pycups-1.9.31.tar.bz2.sig b/pycups-1.9.31.tar.bz2.sig deleted file mode 100644 index 38c2b52d9163b17aad203ef1d0ca0a4e56dd90df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmV-H0KWf-KLZ5-M@3?PX(f@P9=Dkz5dwJC0G%DY?&?~LrQLjgp7rD^qFx}VY0&_l XJZoAkVhdK&6w~|hj%BqOcnNTkbKe}g diff --git a/pycups-1.9.32.tar.bz2.sig b/pycups-1.9.32.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000..d140fe60f78931210e4a36a52df6735a2e885c0e GIT binary patch literal 65 zcmV-H0KWf-KLZ5-M`mBtX(f@P9=Dkz5ds}W0G=T>N$9K)%A~{FM3=ofnV)&0h(Z9K XA^wB7c!EWJ8%?9$;Zxjk0>=o^KzSS$ literal 0 HcmV?d00001 diff --git a/pycups-attributes-uri.patch b/pycups-attributes-uri.patch deleted file mode 100644 index a9c401d..0000000 --- a/pycups-attributes-uri.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff -up pycups-1.9.31/cupsconnection.c.attributes-uri pycups-1.9.31/cupsconnection.c ---- pycups-1.9.31/cupsconnection.c.attributes-uri 2007-11-27 12:47:43.000000000 +0000 -+++ pycups-1.9.31/cupsconnection.c 2007-11-27 12:48:46.000000000 +0000 -@@ -1975,42 +1975,77 @@ PyObject_from_attr_value (ipp_attribute_ - } - - static PyObject * --Connection_getPrinterAttributes (Connection *self, PyObject *args) -+Connection_getPrinterAttributes (Connection *self, PyObject *args, -+ PyObject *kwds) - { - PyObject *ret; -- PyObject *nameobj; -+ PyObject *nameobj = NULL; - char *name; -+ PyObject *uriobj = NULL; -+ char *uri; - ipp_t *request, *answer; - ipp_attribute_t *attr; -- char uri[HTTP_MAX_URI]; -+ char consuri[HTTP_MAX_URI]; - int i; -+ static char *kwlist[] = { "name", "uri", NULL }; -+ -+ if (!PyArg_ParseTupleAndKeywords (args, kwds, "|OO", kwlist, -+ &nameobj, &uriobj)) -+ return NULL; - -- if (!PyArg_ParseTuple (args, "O", &nameobj)) -+ if (nameobj && uriobj) { -+ PyErr_SetString (PyExc_RuntimeError, -+ "name or uri must be specified but not both"); - return NULL; -+ } - -- if (UTF8_from_PyObj (&name, nameobj) == NULL) -+ if (nameobj) { -+ if (UTF8_from_PyObj (&name, nameobj) == NULL) -+ return NULL; -+ } else if (uriobj) { -+ if (UTF8_from_PyObj (&uri, uriobj) == NULL) -+ return NULL; -+ } else { -+ PyErr_SetString (PyExc_RuntimeError, -+ "name or uri must be specified"); - return NULL; -+ } -+ -+ debugprintf ("-> Connection_getPrinterAttributes(%s)\n", -+ nameobj ? name : uri); -+ if (nameobj) { -+ snprintf (consuri, sizeof (consuri), "ipp://localhost/printers/%s", name); -+ free (name); -+ uri = consuri; -+ } - -- snprintf (uri, sizeof (uri), "ipp://localhost/printers/%s", name); - for (i = 0; i < 2; i++) { - request = ippNewRequest (IPP_GET_PRINTER_ATTRIBUTES); - ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); -+ debugprintf ("trying request with uri %s\n", uri); - answer = cupsDoRequest (self->http, request, "/"); - if (answer && answer->request.status.status_code == IPP_NOT_POSSIBLE) { - ippDelete (answer); -+ if (uriobj) -+ break; -+ - // Perhaps it's a class, not a printer. - snprintf (uri, sizeof (uri), "ipp://localhost/classes/%s", name); - } else break; - } - -- free (name); -+ if (uriobj) -+ free (uri); -+ - if (!answer || answer->request.status.status_code > IPP_OK_CONFLICT) { - set_ipp_error (answer ? - answer->request.status.status_code : - cupsLastError ()); - if (answer) - ippDelete (answer); -+ -+ debugprintf ("<- Connection_getPrinterAttributes() (error)\n"); - return NULL; - } - -@@ -2027,6 +2062,7 @@ Connection_getPrinterAttributes (Connect - size_t namelen = strlen (attr->name); - int is_list = attr->num_values > 1; - -+ debugprintf ("Attribute: %s\n", attr->name); - // job-sheets-default is special, since it is always two values. - // Make it a tuple. - if (!strcmp (attr->name, "job-sheets-default") && -@@ -2102,6 +2138,7 @@ Connection_getPrinterAttributes (Connect - break; - } - -+ debugprintf ("<- Connection_getPrinterAttributes() = dict\n"); - return ret; - } - -@@ -3317,13 +3354,17 @@ PyMethodDef Connection_methods[] = - "@raise IPPError: IPP problem" }, - - { "getPrinterAttributes", -- (PyCFunction) Connection_getPrinterAttributes, METH_VARARGS, -- "getPrinterAttributes(name) -> dict\n" -- "Fetch the attributes for a printer.\n\n" -+ (PyCFunction) Connection_getPrinterAttributes, -+ METH_VARARGS | METH_KEYWORDS, -+ "getPrinterAttributes() -> dict\n" -+ "Fetch the attributes for a printer, specified either by name or by \n" -+ "uri but not both.\n\n" - "@type name: string\n" - "@param name: queue name\n" -+ "@type uri: string\n" -+ "@param uri: queue URI\n" - "@return: a dict, indexed by attribute, of printer attributes\n" -- "for the printer 'name'.\n\n" -+ "for the specified printer.\n\n" - "Attributes:\n" - " - 'job-sheets-supported': list of strings\n" - " - 'job-sheets-default': tuple of strings (start, end)\n" -@@ -3332,7 +3373,7 @@ PyMethodDef Connection_methods[] = - " - 'printer-op-policy-supported': if present, list of strings\n" - " - 'printer-op-policy': if present, string\n\n" - "There are other attributes; the exact list of attributes returned \n" -- "will depend on the CUPS server.\n" -+ "will depend on the IPP server.\n" - "@raise IPPError: IPP problem"}, - - { "addPrinterToClass", -diff -U0 pycups-1.9.31/ChangeLog.attributes-uri pycups-1.9.31/ChangeLog diff --git a/pycups-job-sheets.patch b/pycups-job-sheets.patch deleted file mode 100644 index 7b72917..0000000 --- a/pycups-job-sheets.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up pycups-1.9.31/cupsconnection.c.job-sheets pycups-1.9.31/cupsconnection.c ---- pycups-1.9.31/cupsconnection.c.job-sheets 2007-11-22 11:01:19.000000000 +0000 -+++ pycups-1.9.31/cupsconnection.c 2007-11-22 13:27:43.000000000 +0000 -@@ -2042,7 +2042,7 @@ Connection_getPrinterAttributes (Connect - startobj = PyObj_from_UTF8 (start); - endobj = PyObj_from_UTF8 (end); - PyDict_SetItemString (ret, "job-sheets-default", -- Py_BuildValue ("(ss)", startobj, endobj)); -+ Py_BuildValue ("(OO)", startobj, endobj)); - Py_DECREF (startobj); - Py_DECREF (endobj); - continue; -diff -U0 pycups-1.9.31/ChangeLog.job-sheets pycups-1.9.31/ChangeLog ---- pycups-1.9.31/ChangeLog.job-sheets 2007-11-22 11:04:25.000000000 +0000 -+++ pycups-1.9.31/ChangeLog 2007-11-22 13:27:43.000000000 +0000 -@@ -2,0 +3,5 @@ -+ * cupsconnection.c (Connection_getPrinterAttributes): Fixed -+ job-sheets-default tuple. -+ -+2007-11-22 Tim Waugh -+ diff --git a/sources b/sources index 5ac29ab..3f89e3b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -febc7a53ef0fbedbef2d7d8e4b5c92f3 pycups-1.9.31.tar.bz2 300a038e623c4192a68b4a43cf9b5dd8 system-config-printer-0.7.78.tar.bz2 +c88b387b233a0aca280c9d02c4e63a44 pycups-1.9.32.tar.bz2 diff --git a/system-config-printer.spec b/system-config-printer.spec index eec4c0f..ee441de 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -1,4 +1,4 @@ -%define pycups_version 1.9.31 +%define pycups_version 1.9.32 Summary: A printer administration tool Name: system-config-printer @@ -11,8 +11,6 @@ Source0: system-config-printer-%{version}.tar.bz2 Source1: pycups-%{pycups_version}.tar.bz2 Source2: system-config-printer.pam Source3: system-config-printer.console -Patch0: pycups-job-sheets.patch -Patch1: pycups-attributes-uri.patch Patch100: system-config-printer-0.7.x.patch BuildRequires: cups-devel >= 1.2 @@ -55,10 +53,6 @@ the configuration tool. %prep %setup -q -a 1 -pushd pycups-%{pycups_version} -%patch0 -p1 -b .job-sheets -%patch1 -p1 -b .attributes-uri -popd %patch100 -p1 -b .0.7.x @@ -131,6 +125,9 @@ rm -rf %buildroot exit 0 %changelog +* Mon Dec 17 2007 Tim Waugh +- Updated pycups to 1.9.32. + * Tue Nov 27 2007 Tim Waugh 0.7.78-2 - pycups: Applied patch from SVN to allow fetching printer attributes by URI. - Sync to SVN 1748.