summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-08-07 09:10:52 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-08-07 09:10:52 +0000
commit4c9cbe531c33f5fc9e7fe8991991c21df6ea3b3e (patch)
treee298fdb52af03b044e860556341743bb75a93ab2 /net-print
parentRestricting py-2.5 and jython (diff)
downloadhistorical-4c9cbe531c33f5fc9e7fe8991991c21df6ea3b3e.tar.gz
historical-4c9cbe531c33f5fc9e7fe8991991c21df6ea3b3e.tar.bz2
historical-4c9cbe531c33f5fc9e7fe8991991c21df6ea3b3e.zip
Fix build failure with cups-1.6.x (bug #428544, thanks to Diego Elio Pettenò and Andreas K. Hüttel).
Package-Manager: portage-2.2.0_alpha120/cvs/Linux x86_64
Diffstat (limited to 'net-print')
-rw-r--r--net-print/cups-pk-helper/ChangeLog7
-rw-r--r--net-print/cups-pk-helper/Manifest37
-rw-r--r--net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild7
-rw-r--r--net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch340
4 files changed, 368 insertions, 23 deletions
diff --git a/net-print/cups-pk-helper/ChangeLog b/net-print/cups-pk-helper/ChangeLog
index f28fb3b1fa16..f6fc5fefcd9c 100644
--- a/net-print/cups-pk-helper/ChangeLog
+++ b/net-print/cups-pk-helper/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-print/cups-pk-helper
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/ChangeLog,v 1.7 2012/05/27 23:12:09 mattst88 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/ChangeLog,v 1.8 2012/08/07 09:10:52 tetromino Exp $
+
+ 07 Aug 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
+ cups-pk-helper-0.2.2.ebuild, +files/cups-pk-helper-0.2.2-cups-1.6.patch:
+ Fix build failure with cups-1.6.x (bug #428544, thanks to Diego Elio Pettenò
+ and Andreas K. Hüttel).
27 May 2012; Matt Turner <mattst88@gentoo.org> cups-pk-helper-0.2.2.ebuild:
Added ~alpha, bug 379651.
diff --git a/net-print/cups-pk-helper/Manifest b/net-print/cups-pk-helper/Manifest
index e02a1fb35389..759ed2e6ce96 100644
--- a/net-print/cups-pk-helper/Manifest
+++ b/net-print/cups-pk-helper/Manifest
@@ -1,26 +1,21 @@
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA256
-DIST cups-pk-helper-0.2.1.tar.bz2 216528 RMD160 76c414d01653008cbf9df3e1b1dbaaa3aae895ac SHA1 cca085a4424f62f98d6f1014fce278ca4f63bb1c SHA256 b620abc83d5e8595c533264c00c6f6d9f44ec020b62968797747687857679c9c
-DIST cups-pk-helper-0.2.2.tar.xz 213660 RMD160 250c60eaae376bbddc81afb3fb629a210bfe696d SHA1 125f44a13d2a3d8322fde1bb9c1526b659818c0a SHA256 56a10efbc0f37db39a940d99d549c7f37fa95f1af4745b30b79c240b0f37cfd7
-EBUILD cups-pk-helper-0.2.1.ebuild 918 RMD160 584ea204700e5ef7d76063304b19aa8a6bc17c03 SHA1 2695a8c7005f394b9cdb48061fc514f95eed175e SHA256 aea76704d513e93d6a4c586d91bf7d872c16b0333f284e246807c73af538b44f
-EBUILD cups-pk-helper-0.2.2.ebuild 1066 RMD160 0d229c8da72b08e53ea46a21eb5d887e5fd8c12e SHA1 92c6706f543662f56eae4e148ccc1abaf7f64df3 SHA256 8494e9955bcfde0505e53f78a8b0df6ef5b4871be9c5f63c34004888e9e6bb9c
-MISC ChangeLog 1406 RMD160 25b6d2c24362a2ebe462939a99d9f3914aaf9e1c SHA1 dd6de8ee837b08ab7f8856a45da22f45fdc4abda SHA256 eec534bb3848ef6b5f7aa8b56ba57ddcae56d8fd45633155faed0adb7a39e59f
-MISC metadata.xml 159 RMD160 488f58f504e5c2e7b10e253fd9db5f1e6f9d3a21 SHA1 16c86b590ee3d78c8ccd5b5044835ed4a4038d93 SHA256 b1ccd57b80d8d6ee7a9924844efd69830edfb744ab818d67e50a008b5aae7d4b
+AUX cups-pk-helper-0.2.2-cups-1.6.patch 15968 SHA256 aa5dfb9254637b41cf67239c824c6d43e61e5f485f1416c93e5c4ccd326b085a SHA512 5c8028a5a5ceb6eefbb8e307846017b24c9edeefd951fa7fd688840008f6bc09fd02e6d24740cee2054209244e2d5ad85e572fc302da6ecf8ae7d876f99bc8b3 WHIRLPOOL 3988535da0abfc88660d5f4b008aa73b452e6f3d77602c71d4bf050e2c4d8b3fd6296fa894b77166d5283c8af05e3c70a6e586d7773aaa6a3a8f2ec857c7a063
+DIST cups-pk-helper-0.2.1.tar.bz2 216528 SHA256 b620abc83d5e8595c533264c00c6f6d9f44ec020b62968797747687857679c9c SHA512 0cb6696ae02283347af7585bf40f923aeda14fee79a600e01486461e0b10e2ef4918eb40477eeb7d4236b3a25b1b5c3ae5f9dea365425c87a038d566bd71fd08 WHIRLPOOL 4099471c97fc22ccfd8e682fe2d2e005e741499a5b252b791c07fb87079a8b4cb79879b27d4ea7b7aca07974aaa7e142a48389221afd56aedc6769cf0338cbc6
+DIST cups-pk-helper-0.2.2.tar.xz 213660 SHA256 56a10efbc0f37db39a940d99d549c7f37fa95f1af4745b30b79c240b0f37cfd7 SHA512 16a9c0e51470893cbbc554b47a17b7ff1f23018aa5fed43bccda230d9951b4a2a3f3811dd483b6cffe33fd1b54ecbf5896b4ae2e83128a79643885c412d27c32 WHIRLPOOL dfb87d14b5bc9f82a167e79907dffc6d5f0a2719654413a4250d65f1fa2d6f3516dceeb47d03a1ede38592a27c641256f1d78466209c41bef627d90633aa32ca
+EBUILD cups-pk-helper-0.2.1.ebuild 918 SHA256 aea76704d513e93d6a4c586d91bf7d872c16b0333f284e246807c73af538b44f SHA512 6740d1859c8f53e45b51beca6c27d37a86bb1575b26649b7c0d27ff4799a2543970dcea853bb61e8f63eb92c712184725bda8e2cb5bd293f57c4dfa69246fbe2 WHIRLPOOL b6e4aec8530369af0f5e383cbe5bd7807e4e9d140be03f19001d4a5aaccd2f497ad73170bdb8c6bc4b636f036b9ddaf70cacb8074f5647f545d80e33d4d94a67
+EBUILD cups-pk-helper-0.2.2.ebuild 1200 SHA256 956d261c84465121a6a1eac4c3d8a76e26c5c92f17d800011a7b7a985a6378b2 SHA512 0be9496cbf40462c24f63e2fe91680c6cae8f3bc7275268dc5d5fff0dc092ed6fd63191bb2f0253a56f3c8c204fdd54d0b8e1f276f6f178eb8d6488dd9c61358 WHIRLPOOL 884d5fa07c54f973257a982c830be14360086c681459ff89c92f2c972fb9af53c00c32a66fa39c201698052956dd4fe3c33d004034eb2bce8c8dadbc11f76d5b
+MISC ChangeLog 1649 SHA256 d2fabe8794eb3b1b66bff4f821965141545628f9a36461aacd807aa00d5739f4 SHA512 6ccc9e07499a96b2f08ced02e54ebf4a4cd776d17b4710649cd1053fb26e3fd1b7839280b0d556e143d6ca128503c1ec28a5984e1f1685a4b8e5be67a6e3651d WHIRLPOOL 6c482c6e1b3eecfeadf2bcb676d1ed3b584fa9b1fb14c0dda30d94a5d2bbf2e0e56d6acf14ac66df970e5ed43942e748ebe77a4f9a46c2ceeddb6e6c7e9bf9f0
+MISC metadata.xml 159 SHA256 b1ccd57b80d8d6ee7a9924844efd69830edfb744ab818d67e50a008b5aae7d4b SHA512 9408846d0f3194f62043b64e325aed9e8cce9a74b556865acf71facc3ad59a092dccbbb3c608ada40b73625eaac93a7bcc976858c6a47426bb8fadb6f830fe2b WHIRLPOOL 4700c8b71899b5acffcc46580315d4d116b478cfa283e0ea0569ab180e46850ce85d73c7370d989e53dd8aecb69ed843d2716bfebd3c5d74a7b5c3d4b94b96bb
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.19 (GNU/Linux)
-iQIcBAEBAgAGBQJPwrTMAAoJEA/daC2XTKcqLrQP/17eez4tTdqlwV6xMpRQMF2k
-04pkdyc1DNrTXt3aqmJmp7Zo8SM1ZeeZVluXPAXx0CFwqaa1oMYqnCBkEI4tAQEC
-QMT7SnrPND9VWlNpUdQoAGdhJhyngMlTG9LP2NC964B/O2epspJKJvgmeVE50IF6
-WwwOkI1Wgclc5wwINOayzOiXbyzZrw+32R0Af35wpd/wp6JHYNgifPZl1G6iaLu5
-CpJzS78t9vfWTGv1vwErG6lyPvuSRM3aLMDPeaJP0gtDLnQxr6EL0MtZgsqKJ7ec
-R0VRwo/ZUf3EkwU9GxRlS4VUij2Y7XtEHqS/i6N5WGQ/ij60+i/jtkchWMpVZjCx
-FCScQm5ccsSl3yql8Eb6Y1pV0drxfv2BEUZD6QMoF5L6dGuvLRCulnkduEhY1ZcQ
-oUkBGsuNOV5uBsLwHmjn7J0V0OwAg0Sm1KPDoCXnmZd6UCLsKLi/mT+0PV06eqsg
-VDeJarE/H6k4d0CISaGJ3tNGJ3LDcFHUjvzgOTEBTZ8n/+dvhV9kDr7hR2uQQWl5
-ht/iB6rgLynODgHUhdIrnb8TKTkbCBZDFJsczbPhhe/hz0zlcpCpK2QuQpeVWH6v
-wmv62LtGrTrEwXj1xCP+C9VPsuSo+EV/UXGh6Ha3D1dfD49dpglM3pxdC+5mZvuY
-MeiVcQzm7xoQ5DFPzH1l
-=cs+l
+iQEcBAEBCAAGBQJQINuhAAoJEJ0WA1zPCt1hV3YH/19MimaBoUhF5SAOvKDoa0PG
+n5xl3OBqGioiKwpuy2Os/GkcjmRdkWDMH1CRidMjDI4PeKrYpcS0SNqhEVCTIsPx
+s7XM6Jf3xGoDZ3IrLqbVTpjFD1MlMs/x7P0nLLqV8FEwYx5cR4ffNKeGilBwizyb
+vv/qdTNYQ2NKa5yrpx6/ZunHD818bu9qC3DX4R4tkZr5X5Xk/DoN+Rnr9JnCfhCm
+FqMfmAZ3hAZ/QpXCuJtRlOGGCFaHzgjm2rvFmaw0MtZfKS/HT3uiXrOjwDtaympn
+pHdoPPc7mJGlRrjejOfCwiMQZn60XhMPMHtChhkX+AGJNfFmzWU5SJrJhlBFNGU=
+=1CKH
-----END PGP SIGNATURE-----
diff --git a/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild b/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild
index f13f228eec05..7df52dc9494d 100644
--- a/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild
+++ b/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild
@@ -1,9 +1,11 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild,v 1.4 2012/05/27 23:12:09 mattst88 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-print/cups-pk-helper/cups-pk-helper-0.2.2.ebuild,v 1.5 2012/08/07 09:10:52 tetromino Exp $
EAPI="4"
+inherit eutils
+
DESCRIPTION="PolicyKit helper to configure cups with fine-grained privileges"
HOMEPAGE="http://www.freedesktop.org/wiki/Software/cups-pk-helper"
SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.xz"
@@ -30,6 +32,9 @@ DEPEND="${COMMON_DEPEND}
src_prepare() {
DOCS="AUTHORS HACKING NEWS README"
+ # bug #428544, https://bugs.freedesktop.org/show_bug.cgi?id=52265
+ epatch "${FILESDIR}/${PN}-0.2.2-cups-1.6.patch"
+
# Regenerate dbus-codegen files to fix build with glib-2.30.x; bug #410773
rm -v src/cph-iface-mechanism.{c,h} || die
}
diff --git a/net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch b/net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch
new file mode 100644
index 000000000000..c9950b1861b8
--- /dev/null
+++ b/net-print/cups-pk-helper/files/cups-pk-helper-0.2.2-cups-1.6.patch
@@ -0,0 +1,340 @@
+From b72bdab92d4fd89529f76a1188d5961e592f001a Mon Sep 17 00:00:00 2001
+From: Jiri Popelka <jpopelka@redhat.com>
+Date: Thu, 19 Jul 2012 15:07:18 +0200
+Subject: [PATCH] Use ippGet/ippSet (accessors) for IPP API.
+
+CUPS 1.6 makes various structures private and
+introduces these ippGet and ippSet functions
+for all of the fields in these structures.
+http://www.cups.org/str.php?L3928
+
+We define our own accessors when CUPS < 1.6.
+---
+ src/cups.c | 153 ++++++++++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 96 insertions(+), 57 deletions(-)
+
+diff --git a/src/cups.c b/src/cups.c
+index 1b2562b..2529f9a 100644
+--- a/src/cups.c
++++ b/src/cups.c
+@@ -47,6 +47,45 @@
+
+ #include "cups.h"
+
++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
++#define HAVE_CUPS_1_6 1
++#endif
++
++#ifndef HAVE_CUPS_1_6
++#define ippGetCount(attr) attr->num_values
++#define ippGetGroupTag(attr) attr->group_tag
++#define ippGetValueTag(attr) attr->value_tag
++#define ippGetName(attr) attr->name
++#define ippGetStatusCode(ipp) ipp->request.status.status_code
++#define ippGetString(attr, element, language) attr->values[element].string.text
++
++static ipp_attribute_t *
++ippFirstAttribute(ipp_t *ipp)
++{
++ if (!ipp)
++ return (NULL);
++ return (ipp->current = ipp->attrs);
++}
++
++static ipp_attribute_t *
++ippNextAttribute(ipp_t *ipp)
++{
++ if (!ipp || !ipp->current)
++ return (NULL);
++ return (ipp->current = ipp->current->next);
++}
++
++static int
++ippSetString(ipp_t *ipp,
++ ipp_attribute_t **attr,
++ int element,
++ const char *strvalue)
++{
++ (*attr)->values[element].string.text = (char *) strvalue;
++ return (1);
++}
++#endif
++
+ /* This is 0.1 second */
+ #define RECONNECT_DELAY 100000
+ /* We try to reconnect during 3 seconds. It's still a fairly long time even for
+@@ -560,7 +599,7 @@ _cph_cups_set_error_from_reply (CphCups *cups,
+ ipp_t *reply)
+ {
+ if (reply)
+- cups->priv->last_status = reply->request.status.status_code;
++ cups->priv->last_status = ippGetStatusCode (reply);
+ else
+ cups->priv->last_status = cupsLastError ();
+ }
+@@ -573,7 +612,7 @@ _cph_cups_is_reply_ok (CphCups *cups,
+ /* reset the internal status: we'll use the cups status */
+ _cph_cups_set_internal_status (cups, NULL);
+
+- if (reply && reply->request.status.status_code <= IPP_OK_CONFLICT) {
++ if (reply && ippGetStatusCode (reply) <= IPP_OK_CONFLICT) {
+ cups->priv->last_status = IPP_OK;
+ return TRUE;
+ } else {
+@@ -767,28 +806,28 @@ _cph_cups_send_new_job_attributes_request (CphCups *cups,
+ }
+
+ static const char *
+-_cph_cups_get_attribute_string (ipp_attribute_t *attrs,
++_cph_cups_get_attribute_string (ipp_t *reply,
+ ipp_tag_t group,
+ const char *name,
+ ipp_tag_t type)
+ {
+ ipp_attribute_t *attr;
+
+- for (attr = attrs; attr; attr = attr->next) {
+- while (attr && attr->group_tag != group)
+- attr = attr->next;
++ for (attr = ippFirstAttribute (reply); attr; attr = ippNextAttribute (reply)) {
++ while (attr && ippGetGroupTag (attr) != group)
++ attr = ippNextAttribute (reply);
+
+ if (attr == NULL)
+ break;
+
+- while (attr && attr->group_tag == group) {
+- if (attr->name &&
+- strcmp (attr->name, name) == 0 &&
+- attr->value_tag == type) {
+- return attr->values[0].string.text;
++ while (attr && ippGetGroupTag (attr) == group) {
++ if (ippGetName (attr) &&
++ strcmp (ippGetName (attr), name) == 0 &&
++ ippGetValueTag (attr) == type) {
++ return ippGetString (attr, 0, NULL);
+ }
+
+- attr = attr->next;
++ attr = ippNextAttribute (reply);
+ }
+
+ if (attr == NULL)
+@@ -832,8 +871,8 @@ _cph_cups_class_has_printer (CphCups *cups,
+ if (!printer_names)
+ goto out;
+
+- for (i = 0; i < printer_names->num_values; i++) {
+- if (!g_ascii_strcasecmp (printer_names->values[i].string.text,
++ for (i = 0; i < ippGetCount (printer_names); i++) {
++ if (!g_ascii_strcasecmp (ippGetString (printer_names, i, NULL),
+ printer_name)) {
+ retval = i;
+ break;
+@@ -877,7 +916,7 @@ _cph_cups_printer_class_set_users (CphCups *cups,
+ attr = ippAddStrings (request, IPP_TAG_PRINTER, IPP_TAG_NAME,
+ request_name, len ? len : 1, NULL, NULL);
+ if (len == 0)
+- attr->values[0].string.text = g_strdup (default_value);
++ ippSetString (request, &attr, 0, g_strdup (default_value));
+ else {
+ int i, j;
+ for (i = 0, j = 0; i < real_len && j < len; i++) {
+@@ -885,7 +924,7 @@ _cph_cups_printer_class_set_users (CphCups *cups,
+ if (users[i][0] == '\0')
+ continue;
+
+- attr->values[j].string.text = g_strdup (users[i]);
++ ippSetString (request, &attr, j, g_strdup (users[i]));
+ j++;
+ }
+ }
+@@ -903,7 +942,7 @@ _cph_cups_printer_class_set_users (CphCups *cups,
+ attr = ippAddStrings (request, IPP_TAG_PRINTER, IPP_TAG_NAME,
+ request_name, len ? len : 1, NULL, NULL);
+ if (len == 0)
+- attr->values[0].string.text = g_strdup (default_value);
++ ippSetString (request, &attr, 0, g_strdup (default_value));
+ else {
+ int i, j;
+ for (i = 0, j = 0; i < real_len && j < len; i++) {
+@@ -911,7 +950,7 @@ _cph_cups_printer_class_set_users (CphCups *cups,
+ if (users[i][0] == '\0')
+ continue;
+
+- attr->values[j].string.text = g_strdup (users[i]);
++ ippSetString (request, &attr, j, g_strdup (users[i]));
+ j++;
+ }
+ }
+@@ -1002,7 +1041,7 @@ cph_cups_printer_get_uri (CphCups *cups,
+ if (!_cph_cups_is_reply_ok (cups, reply, TRUE))
+ return NULL;
+
+- const_uri = _cph_cups_get_attribute_string (reply->attrs, IPP_TAG_PRINTER,
++ const_uri = _cph_cups_get_attribute_string (reply, IPP_TAG_PRINTER,
+ attrs[0], IPP_TAG_URI);
+
+ uri = NULL;
+@@ -1361,7 +1400,7 @@ _cph_cups_devices_get_old (CphCups *cups,
+ attr = ippAddStrings (request, IPP_TAG_OPERATION, IPP_TAG_NAME,
+ "include-schemes", len_include, NULL, NULL);
+ for (i = 0; i < len_include; i++)
+- attr->values[i].string.text = g_strdup (include_schemes[i]);
++ ippSetString (request, &attr, i, g_strdup (include_schemes[i]));
+ }
+
+ if (exclude_schemes && len_exclude > 0) {
+@@ -1370,7 +1409,7 @@ _cph_cups_devices_get_old (CphCups *cups,
+ attr = ippAddStrings (request, IPP_TAG_OPERATION, IPP_TAG_NAME,
+ "exclude-schemes", len_exclude, NULL, NULL);
+ for (i = 0; i < len_exclude; i++)
+- attr->values[i].string.text = g_strdup (exclude_schemes[i]);
++ ippSetString (request, &attr, i, g_strdup (exclude_schemes[i]));
+ }
+
+ resource_char = _cph_cups_get_resource (CPH_RESOURCE_ROOT);
+@@ -1380,9 +1419,9 @@ _cph_cups_devices_get_old (CphCups *cups,
+ if (!_cph_cups_is_reply_ok (cups, reply, TRUE))
+ return FALSE;
+
+- for (attr = reply->attrs; attr; attr = attr->next) {
+- while (attr && attr->group_tag != IPP_TAG_PRINTER)
+- attr = attr->next;
++ for (attr = ippFirstAttribute (reply); attr; attr = ippNextAttribute (reply)) {
++ while (attr && ippGetGroupTag (attr) != IPP_TAG_PRINTER)
++ attr = ippNextAttribute (reply);
+
+ if (attr == NULL)
+ break;
+@@ -1394,29 +1433,29 @@ _cph_cups_devices_get_old (CphCups *cups,
+ device_make_and_model = NULL;
+ device_uri = NULL;
+
+- while (attr && attr->group_tag == IPP_TAG_PRINTER) {
+- if (attr->name == NULL)
++ while (attr && ippGetGroupTag (attr) == IPP_TAG_PRINTER) {
++ if (ippGetName (attr) == NULL)
+ /* nothing, just skip */;
+- else if (strcmp (attr->name, "device-class") == 0 &&
+- attr->value_tag == IPP_TAG_KEYWORD)
+- device_class = g_strdup (attr->values[0].string.text);
+- else if (strcmp (attr->name, "device-id") == 0 &&
+- attr->value_tag == IPP_TAG_TEXT)
+- device_id = g_strdup (attr->values[0].string.text);
+- else if (strcmp (attr->name, "device-info") == 0 &&
+- attr->value_tag == IPP_TAG_TEXT)
+- device_info = g_strdup (attr->values[0].string.text);
+- else if (strcmp (attr->name, "device-location") == 0 &&
+- attr->value_tag == IPP_TAG_TEXT)
+- device_location = g_strdup (attr->values[0].string.text);
+- else if (strcmp (attr->name, "device-make-and-model") == 0 &&
+- attr->value_tag == IPP_TAG_TEXT)
+- device_make_and_model = g_strdup (attr->values[0].string.text);
+- else if (strcmp (attr->name, "device-uri") == 0 &&
+- attr->value_tag == IPP_TAG_URI)
+- device_uri = g_strdup (attr->values[0].string.text);
+-
+- attr = attr->next;
++ else if (strcmp (ippGetName (attr), "device-class") == 0 &&
++ ippGetValueTag (attr) == IPP_TAG_KEYWORD)
++ device_class = g_strdup (ippGetString (attr, 0, NULL));
++ else if (strcmp (ippGetName (attr), "device-id") == 0 &&
++ ippGetValueTag (attr) == IPP_TAG_TEXT)
++ device_id = g_strdup (ippGetString (attr, 0, NULL));
++ else if (strcmp (ippGetName (attr), "device-info") == 0 &&
++ ippGetValueTag (attr) == IPP_TAG_TEXT)
++ device_info = g_strdup (ippGetString (attr, 0, NULL));
++ else if (strcmp (ippGetName (attr), "device-location") == 0 &&
++ ippGetValueTag (attr) == IPP_TAG_TEXT)
++ device_location = g_strdup (ippGetString (attr, 0, NULL));
++ else if (strcmp (ippGetName (attr), "device-make-and-model") == 0 &&
++ ippGetValueTag (attr) == IPP_TAG_TEXT)
++ device_make_and_model = g_strdup (ippGetString (attr, 0, NULL));
++ else if (strcmp (ippGetName (attr), "device-uri") == 0 &&
++ ippGetValueTag (attr) == IPP_TAG_URI)
++ device_uri = g_strdup (ippGetString (attr, 0, NULL));
++
++ attr = ippNextAttribute (reply);
+ }
+
+ if (device_uri)
+@@ -1758,7 +1797,7 @@ cph_cups_class_add_printer (CphCups *cups,
+ printer_uris = ippFindAttribute (reply,
+ "member-uris", IPP_TAG_URI);
+ if (printer_uris)
+- new_len += printer_uris->num_values;
++ new_len += ippGetCount (printer_uris);
+ } else
+ printer_uris = NULL;
+
+@@ -1768,14 +1807,14 @@ cph_cups_class_add_printer (CphCups *cups,
+ if (printer_uris) {
+ int i;
+
+- for (i = 0; i < printer_uris->num_values; i++)
+- attr->values[i].string.text = g_strdup (printer_uris->values[i].string.text);
++ for (i = 0; i < ippGetCount (printer_uris); i++)
++ ippSetString (request, &attr, i, g_strdup (ippGetString (printer_uris, i, NULL)));
+ }
+
+ if (reply)
+ ippDelete (reply);
+
+- attr->values[new_len - 1].string.text = g_strdup (printer_uri);
++ ippSetString (request, &attr, new_len - 1, g_strdup (printer_uri));
+
+ return _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN);
+ }
+@@ -1827,7 +1866,7 @@ cph_cups_class_delete_printer (CphCups *cups,
+ printer_uris = ippFindAttribute (reply,
+ "member-uris", IPP_TAG_URI);
+ if (printer_uris)
+- new_len += printer_uris->num_values;
++ new_len += ippGetCount (printer_uris);
+
+ /* empty class: we delete it */
+ if (new_len <= 0) {
+@@ -1847,9 +1886,9 @@ cph_cups_class_delete_printer (CphCups *cups,
+
+ /* copy all printers from the class, except the one we remove */
+ for (i = 0; i < printer_index; i++)
+- attr->values[i].string.text = g_strdup (printer_uris->values[i].string.text);
+- for (i = printer_index + 1; i < printer_uris->num_values; i++)
+- attr->values[i].string.text = g_strdup (printer_uris->values[i].string.text);
++ ippSetString (request, &attr, i, g_strdup (ippGetString (printer_uris, i, NULL)));
++ for (i = printer_index + 1; i < ippGetCount (printer_uris); i++)
++ ippSetString (request, &attr, i, g_strdup (ippGetString (printer_uris, i, NULL)));
+
+ ippDelete (reply);
+
+@@ -2146,7 +2185,7 @@ cph_cups_printer_class_set_option_default (CphCups *cups,
+ option_name, len, NULL, NULL);
+
+ for (i = 0; i < len; i++)
+- attr->values[i].string.text = g_strdup (values[i]);
++ ippSetString (request, &attr, i, g_strdup (values[i]));
+ }
+
+ retval = _cph_cups_send_request (cups, request, CPH_RESOURCE_ADMIN);
+@@ -2371,7 +2410,7 @@ cph_cups_printer_class_set_option (CphCups *cups,
+ option, len, NULL, NULL);
+
+ for (i = 0; i < len; i++)
+- attr->values[i].string.text = g_strdup (values[i]);
++ ippSetString (request, &attr, i, g_strdup (values[i]));
+ }
+
+ if (newppdfile) {
+@@ -2490,7 +2529,7 @@ cph_cups_job_get_status (CphCups *cups,
+ if (!_cph_cups_is_reply_ok (cups, reply, TRUE))
+ return CPH_JOB_STATUS_INVALID;
+
+- orig_user = _cph_cups_get_attribute_string (reply->attrs, IPP_TAG_JOB,
++ orig_user = _cph_cups_get_attribute_string (reply, IPP_TAG_JOB,
+ attrs[0], IPP_TAG_NAME);
+
+ status = CPH_JOB_STATUS_INVALID;
+--
+1.7.10.4
+