pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/netatalk22



Module Name:    pkgsrc
Committed By:   hauke
Date:           Sat Nov 23 17:55:02 UTC 2019

Modified Files:
        pkgsrc/net/netatalk22: Makefile distinfo
Added Files:
        pkgsrc/net/netatalk22/patches: patch-etc_papd_print_cups.c

Log Message:
Newer cups versions are actively deprecating APIs, and access to
struct fields is now exclusively through accessor functions.

Deal with both issues.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 pkgsrc/net/netatalk22/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/net/netatalk22/distinfo
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/net/netatalk22/patches/patch-etc_papd_print_cups.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/netatalk22/Makefile
diff -u pkgsrc/net/netatalk22/Makefile:1.24 pkgsrc/net/netatalk22/Makefile:1.25
--- pkgsrc/net/netatalk22/Makefile:1.24 Sun Nov  3 11:45:44 2019
+++ pkgsrc/net/netatalk22/Makefile      Sat Nov 23 17:55:01 2019
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.24 2019/11/03 11:45:44 rillig Exp $
+# $NetBSD: Makefile,v 1.25 2019/11/23 17:55:01 hauke Exp $
 
 DISTNAME=      netatalk-2.2.6
 PKGNAME=       ${DISTNAME:C/-/22-/}
-PKGREVISION=   13
+PKGREVISION=   14
 CATEGORIES=    net print
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=netatalk/}
 EXTRACT_SUFX=  .tar.bz2
@@ -69,7 +69,7 @@ PLIST.rcd=            yes
 
 PLIST_VARS+=           ea
 .if ${OPSYS} == "SunOS" || ${OPSYS} == "DragonFly" || ${OPSYS} == "Linux" || \
-       (${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-6].[0-8]*)) || \
+       (${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-6].[0-8].*)) || \
        ${OPSYS} == "FreeBSD"
 PLIST.ea=              yes
 .endif

Index: pkgsrc/net/netatalk22/distinfo
diff -u pkgsrc/net/netatalk22/distinfo:1.7 pkgsrc/net/netatalk22/distinfo:1.8
--- pkgsrc/net/netatalk22/distinfo:1.7  Sun Jun  2 20:03:32 2019
+++ pkgsrc/net/netatalk22/distinfo      Sat Nov 23 17:55:01 2019
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2019/06/02 20:03:32 rjs Exp $
+$NetBSD: distinfo,v 1.8 2019/11/23 17:55:01 hauke Exp $
 
 SHA1 (netatalk-2.2.6.tar.bz2) = 98a2d33f2e240e49caec32b83bca579723ce87f7
 RMD160 (netatalk-2.2.6.tar.bz2) = c7b051cf89d30c9bf1d491d9e04ceee2f39b897d
@@ -7,6 +7,7 @@ Size (netatalk-2.2.6.tar.bz2) = 1301887 
 SHA1 (patch-config_Makefile.in) = 6b9f545e5ddb178e9a310cec4de300c02557e685
 SHA1 (patch-configure) = 9919625c3cd54e34ab45c6606094e12215630d33
 SHA1 (patch-distrib_initscripts_Makefile.in) = 706890f9e0aacab4d523cc1900048b7fab96f5d4
+SHA1 (patch-etc_papd_print_cups.c) = 8dada275f9525b9229a85492050de982b1e54295
 SHA1 (patch-etc_uams_uams__dhx__pam.c) = 9c75c8562271204c6be974af189e48a9a1b35e11
 SHA1 (patch-etc_uams_uams__dhx__passwd.c) = eb950f16b8d9c00ff45e40769f01850138e76176
 SHA1 (patch-etc_uams_uams__randnum.c) = ff9f698156e0954000e95ac0fbd9b9604d15b8d1

Added files:

Index: pkgsrc/net/netatalk22/patches/patch-etc_papd_print_cups.c
diff -u /dev/null pkgsrc/net/netatalk22/patches/patch-etc_papd_print_cups.c:1.3
--- /dev/null   Sat Nov 23 17:55:02 2019
+++ pkgsrc/net/netatalk22/patches/patch-etc_papd_print_cups.c   Sat Nov 23 17:55:02 2019
@@ -0,0 +1,124 @@
+$NetBSD: patch-etc_papd_print_cups.c,v 1.3 2019/11/23 17:55:02 hauke Exp $
+
+Deprecated functions: Remove obsolete define, and disable compiler
+errors for deprecation warnings, as seen in the darktable print code.
+
+Accessors: Cups has abstracted away access to ipp_t fields, use
+accessor functions.
+
+--- etc/papd/print_cups.c.orig 2017-07-09 11:03:31.000000000 +0000
++++ etc/papd/print_cups.c
+@@ -39,11 +39,11 @@
+ 
+ #ifdef HAVE_CUPS
+ 
+-/* enable pre-1.6 CUPS API for now */
+-#define _PPD_DEPRECATED
+-
+-/* expose structs that are private post-1.5 CUPS */
+-#define _IPP_PRIVATE_STRUCTURES 1
++/*
++ * Do not error out on deprecation messages
++ * -- darktable does this in their "src/common/cups_print.c"
++ */
++#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ 
+ #include <cups/ipp.h>
+ #include <cups/cups.h>
+@@ -61,6 +61,11 @@
+ #define MAXCHOOSERLEN 31
+ #define HTTP_MAX_URI 1024
+ 
++/* Deal with post-1.7 deprecated httpConnect() */
++#define httpConnect(host, port)               httpConnect2(host, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_IF_REQUESTED, 1, 1000, NULL)
++
++/* XXX Also: cupsGetPPD() */
++
+ static const char* cups_status_msg[] = {
+         "status: busy; info: \"%s\" is rejecting jobs; ",
+         "status: idle; info: \"%s\" is stopped, accepting jobs ;",
+@@ -136,12 +141,8 @@ cups_printername_ok(char *name)         
+         *    requested-attributes
+         *    printer-uri
+         */
+-
+-        request = ippNew();
+-
+-        request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
+-        request->request.op.request_id   = 1;
+-
++      request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
++      
+         language = cupsLangDefault();
+ 
+         ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+@@ -172,10 +173,11 @@ cups_printername_ok(char *name)         
+ 
+         httpClose(http);
+ 
+-        if (response->request.status.status_code >= IPP_OK_CONFLICT)
++      if ( cupsLastError() >= IPP_OK_CONFLICT)        
+         {
+                       LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", name,
+-                         ippErrorString(response->request.status.status_code));
++                  ippErrorString(cupsLastError()));
++
+                 ippDelete(response);
+                 return (0);
+         }
+@@ -249,10 +251,7 @@ cups_get_printer_status (struct printer 
+         *    printer-uri
+         */
+ 
+-        request = ippNew();
+-
+-        request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
+-        request->request.op.request_id   = 1;
++      request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
+ 
+         language = cupsLangDefault();
+ 
+@@ -282,10 +281,11 @@ cups_get_printer_status (struct printer 
+                 return (0);
+         }
+ 
+-        if (response->request.status.status_code >= IPP_OK_CONFLICT)
++      if (cupsLastError() >= IPP_OK_CONFLICT)
+         {
+-                      LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", pr->p_printer,
+-                         ippErrorString(response->request.status.status_code));
++              LOG(log_error, logtype_papd, "Unable to get printer status for %s - %s", pr->p_printer,
++                       ippErrorString(cupsLastError()));
++
+                 ippDelete(response);
+                 httpClose(http);
+                 return (0);
+@@ -299,9 +299,9 @@ cups_get_printer_status (struct printer 
+ 
+         if ((attr = ippFindAttribute(response, "printer-state", IPP_TAG_ENUM)) != NULL)
+         {
+-                if (attr->values[0].integer == IPP_PRINTER_STOPPED)
++              if (ippGetInteger(attr, 0) == IPP_PRINTER_STOPPED)
+                       status = 1;
+-                else if (attr->values[0].integer == IPP_NOT_ACCEPTING)
++              else if (ippGetInteger(attr,0) == IPP_NOT_ACCEPTING)
+                       status = 0;
+               else
+                       status = 2;
+@@ -309,14 +309,14 @@ cups_get_printer_status (struct printer 
+ 
+       if ((attr = ippFindAttribute(response, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN)) != NULL)
+       {
+-              if ( attr->values[0].integer == 0 ) 
++              if ( ippGetInteger(attr, 0) == 0 )      
+                       status = 0;
+       }
+               
+       snprintf ( pr->p_status, 255, cups_status_msg[status], pr->p_printer );
+ 
+         if ((attr = ippFindAttribute(response, "printer-state-message", IPP_TAG_TEXT)) != NULL)
+-              strncat ( pr->p_status, attr->values[0].string.text, 255-strlen(pr->p_status));
++              strncat ( pr->p_status, ippGetString(attr, 0, NULL), 255-strlen(pr->p_status)); 
+ 
+         ippDelete(response);
+ 



Home | Main Index | Thread Index | Old Index