[arch-commits] Commit in cups-filters/trunk (PKGBUILD bazaar_rev7537.diff)

Andreas Radke andyrtr at archlinux.org
Tue Sep 20 17:17:26 UTC 2016


    Date: Tuesday, September 20, 2016 @ 17:17:25
  Author: andyrtr
Revision: 276773

upgpkg: cups-filters 1.11.3-2

apply upstream fix for unneeded calls of handle_cups_queues

Added:
  cups-filters/trunk/bazaar_rev7537.diff
Modified:
  cups-filters/trunk/PKGBUILD

---------------------+
 PKGBUILD            |   16 +++-
 bazaar_rev7537.diff |  166 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 178 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-09-20 15:52:58 UTC (rev 276772)
+++ PKGBUILD	2016-09-20 17:17:25 UTC (rev 276773)
@@ -3,10 +3,10 @@
 
 pkgname=cups-filters
 pkgver=1.11.3
-pkgrel=1
+pkgrel=2
 pkgdesc="OpenPrinting CUPS Filters"
 arch=('i686' 'x86_64')
-url="http://www.linuxfoundation.org/collaborate/workgroups/openprinting"
+url="https://wiki.linuxfoundation.org/openprinting/cups-filters"
 license=('custom')
 depends=('lcms2' 'poppler' 'qpdf' 'imagemagick' 'liblouis' 'ijs' 'libcups')
 makedepends=('ghostscript' 'ttf-dejavu' 'python') # ttf-dejavu for make check
@@ -17,12 +17,20 @@
 	    'antiword: needed to convert MS Word documents (requires also docx2txt (AUR)')
 backup=(etc/fonts/conf.d/99pdftoopvp.conf
         etc/cups/cups-browsed.conf)
-source=(http://www.openprinting.org/download/cups-filters/$pkgname-$pkgver.tar.xz)
+source=(http://www.openprinting.org/download/cups-filters/$pkgname-$pkgver.tar.xz
+       bazaar_rev7537.diff)
 provides=('foomatic-filters')
 replaces=('foomatic-filters')
 conflicts=('foomatic-filters')
-md5sums=('3e7ec44dc9b977f1beb64df49041004f')
+md5sums=('3e7ec44dc9b977f1beb64df49041004f'
+         '3c917d4d0091edfb89f34f8a37df91ef')
 
+prepare() {
+  cd $pkgname-$pkgver
+  # avoid unneeded calls of handle_cups_queues() and even infinite loops
+  patch -Np0 -i ../bazaar_rev7537.diff
+}
+
 build() {
   cd $pkgname-$pkgver
   ./configure --prefix=/usr  \

Added: bazaar_rev7537.diff
===================================================================
--- bazaar_rev7537.diff	                        (rev 0)
+++ bazaar_rev7537.diff	2016-09-20 17:17:25 UTC (rev 276773)
@@ -0,0 +1,166 @@
+=== modified file 'NEWS'
+--- NEWS	2016-09-15 18:00:07 +0000
++++ NEWS	2016-09-20 02:30:28 +0000
+@@ -1,6 +1,13 @@
+ NEWS - OpenPrinting CUPS Filters v1.11.3 - 2016-09-15
+ -----------------------------------------------------
+ 
++CHANGES IN V1.11.4
++
++	- cups-browsed: Fixes to avoid unneeded calls of
++	  handle_cups_queues() and even infinite loops (Possible fix
++	  for bug #1376). Also make sure that queues left over from
++	  the previous cups-browsed session are integrated correctly.
++
+ CHANGES IN V1.11.3
+ 
+ 	- cups-browsed: If a queue is not only discovered via Bonjour
+
+=== modified file 'utils/cups-browsed.c'
+--- utils/cups-browsed.c	2016-09-14 15:48:33 +0000
++++ utils/cups-browsed.c	2016-09-20 02:30:28 +0000
+@@ -585,11 +585,15 @@
+ static http_t *
+ http_connect_local (void)
+ {
+-  debug_printf("cups-browsed: Creating http connection to local CUPS daemon: %s:%d\n", cupsServer(), ippPort());
+-  if (!local_conn)
++  if (!local_conn) {
++    debug_printf("cups-browsed: Creating http connection to local CUPS daemon: %s:%d\n", cupsServer(), ippPort());
+     local_conn = httpConnectEncryptShortTimeout(cupsServer(), ippPort(),
+ 						cupsEncryption());
+-  httpSetTimeout(local_conn, 3, http_timeout_cb, NULL);
++  }
++  if (local_conn)
++    httpSetTimeout(local_conn, 3, http_timeout_cb, NULL);
++  else
++    debug_printf("cups-browsed: Failed creating http connection to local CUPS daemon: %s:%d\n", cupsServer(), ippPort());
+ 
+   return local_conn;
+ }
+@@ -3946,24 +3950,18 @@
+       break;
+ 
+     case STATUS_CONFIRMED:
+-      if (p->is_legacy && p->timeout > current_time) {
++      /* Only act if the timeout has passed */
++      if (p->timeout > current_time)
++	break;
++
++      if (p->is_legacy) {
+ 	/* Remove a queue based on a legacy CUPS broadcast when the
+ 	   broadcast timeout expires without a new broadcast of this
+ 	   queue from the server */
+ 	p->status = STATUS_DISAPPEARED;
+ 	p->timeout = time(NULL) + TIMEOUT_IMMEDIATELY;
+-      } else {
+-	/* If this queue was the default printer in its previous life, make
+-	   it the default printer again. */
+-	queue_creation_handle_default(p->name);
+-
+-	/* If this queue is disabled, re-enable it. */
+-	enable_printer(p->name);
+-
+-	/* Record the options, to record any changes which happened
+-	   while cups-browsed was not running */
+-	record_printer_options(p->name);
+-      }
++      } else
++	p->timeout = (time_t) -1;
+ 
+       break;
+ 
+@@ -4002,11 +4000,11 @@
+     g_source_remove (queues_timer_id);
+ 
+   if (timeout != (time_t) -1) {
++    debug_printf("checking queues in %ds\n", timeout);
+     queues_timer_id = g_timeout_add_seconds (timeout, handle_cups_queues, NULL);
+-    debug_printf("checking queues in %ds\n", timeout);
+   } else {
++    debug_printf("listening\n");
+     queues_timer_id = 0;
+-    debug_printf("listening\n");
+   }
+ }
+ 
+@@ -4403,6 +4401,8 @@
+   }
+ 
+   if (p) {
++    debug_printf("Entry for %s (URI: %s) already exists.\n",
++		 p->name, p->uri);
+     /* We have already created a local queue, check whether the
+        discovered service allows us to upgrade the queue to IPPS
+        or whether the URI part after ipp(s):// has changed, or
+@@ -4453,26 +4453,31 @@
+       p->type = strdup(type);
+       p->domain = strdup(domain);
+ 
+-    } else {
++    }
+ 
+-      /* Nothing to do, mark queue entry as confirmed if the entry
+-	 is unconfirmed */
+-      debug_printf("Entry for %s (URI: %s) already exists.\n",
++    /* Mark queue entry as confirmed if the entry
++       is unconfirmed */
++    if (p->status == STATUS_UNCONFIRMED ||
++	p->status == STATUS_DISAPPEARED) {
++      debug_printf("Marking entry for %s (URI: %s) as confirmed.\n",
+ 		   p->name, p->uri);
+-      if (p->status == STATUS_UNCONFIRMED ||
+-	  p->status == STATUS_DISAPPEARED) {
+-	p->status = STATUS_CONFIRMED;
+-	if (p->is_legacy) {
+-	  p->timeout = time(NULL) + BrowseTimeout;
+-	  debug_printf("starting BrowseTimeout timer for %s (%ds)\n",
+-		       p->name, BrowseTimeout);
+-	} else
+-	  p->timeout = (time_t) -1;
+-	debug_printf("Marking entry for %s (URI: %s) as confirmed.\n",
+-		     p->name, p->uri);
+-      }
++      p->status = STATUS_CONFIRMED;
++      if (p->is_legacy) {
++	p->timeout = time(NULL) + BrowseTimeout;
++	debug_printf("starting BrowseTimeout timer for %s (%ds)\n",
++		     p->name, BrowseTimeout);
++      } else
++	p->timeout = (time_t) -1;
++      /* If this queue was the default printer in its previous life, make
++	 it the default printer again. */
++      queue_creation_handle_default(p->name);
++      /* If this queue is disabled, re-enable it. */
++      enable_printer(p->name);
++      /* Record the options, to record any changes which happened
++	 while cups-browsed was not running */
++      record_printer_options(p->name);
++    }
+ 
+-    }
+     if (p->host[0] == '\0') {
+       free (p->host);
+       p->host = strdup(remote_host);
+@@ -5526,8 +5531,6 @@
+ 
+   g_list_free_full (context->printers, browsepoll_printer_free);
+   context->printers = printers;
+-  if (in_shutdown == 0)
+-    recheck_timer ();
+ 
+ fail:
+   if (response)
+@@ -5785,7 +5788,10 @@
+ 
+   inhibit_local_printers_update = FALSE;
+ 
+-fail:
++  if (in_shutdown == 0)
++    recheck_timer ();
++
++ fail:
+ 
+   if (conn)
+     httpClose (conn);
+



More information about the arch-commits mailing list