packages: cups/cups-avahi-1-config.patch, cups/cups-avahi-2-backend.patch, =?UTF-8?Q?=20?=...

baggins baggins at pld-linux.org
Sat Jun 30 14:19:22 CEST 2012


Author: baggins                      Date: Sat Jun 30 12:19:22 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 1.5.3
- disabled ipp backend revert, should work fine now
- locale patch applied upstream
- updated avahi patch from fedora

---- Files affected:
packages/cups:
   cups-avahi-1-config.patch (1.1 -> 1.2) , cups-avahi-2-backend.patch (1.3 -> 1.4) , cups-avahi-3-timeouts.patch (1.1 -> 1.2) , cups-avahi-4-poll.patch (1.1 -> 1.2) , cups-avahi-5-services.patch (1.3 -> 1.4) , cups.spec (1.330 -> 1.331) , cups-locale.patch (1.1 -> NONE)  (REMOVED)

---- Diffs:

================================================================
Index: packages/cups/cups-avahi-1-config.patch
diff -u packages/cups/cups-avahi-1-config.patch:1.1 packages/cups/cups-avahi-1-config.patch:1.2
--- packages/cups/cups-avahi-1-config.patch:1.1	Wed Dec 14 23:15:07 2011
+++ packages/cups/cups-avahi-1-config.patch	Sat Jun 30 14:19:17 2012
@@ -1,6 +1,6 @@
-diff -up cups-1.5.0/config.h.in.avahi-1-config cups-1.5.0/config.h.in
---- cups-1.5.0/config.h.in.avahi-1-config	2011-06-16 21:12:16.000000000 +0100
-+++ cups-1.5.0/config.h.in	2011-08-05 15:04:09.535759988 +0100
+diff -up cups-1.5.2/config.h.in.avahi-1-config cups-1.5.2/config.h.in
+--- cups-1.5.2/config.h.in.avahi-1-config	2011-06-16 21:12:16.000000000 +0100
++++ cups-1.5.2/config.h.in	2012-03-14 15:04:51.365347165 +0000
 @@ -390,6 +390,13 @@
  
  
@@ -15,9 +15,9 @@
   * Do we have <sys/ioctl.h>?
   */
  
-diff -up cups-1.5.0/config-scripts/cups-dnssd.m4.avahi-1-config cups-1.5.0/config-scripts/cups-dnssd.m4
---- cups-1.5.0/config-scripts/cups-dnssd.m4.avahi-1-config	2011-05-12 06:21:56.000000000 +0100
-+++ cups-1.5.0/config-scripts/cups-dnssd.m4	2011-08-05 15:04:09.525760307 +0100
+diff -up cups-1.5.2/config-scripts/cups-dnssd.m4.avahi-1-config cups-1.5.2/config-scripts/cups-dnssd.m4
+--- cups-1.5.2/config-scripts/cups-dnssd.m4.avahi-1-config	2011-05-12 06:21:56.000000000 +0100
++++ cups-1.5.2/config-scripts/cups-dnssd.m4	2012-03-14 15:04:51.365347165 +0000
 @@ -23,6 +23,21 @@ AC_ARG_WITH(dnssd-includes, [  --with-dn
  DNSSDLIBS=""
  DNSSD_BACKEND=""

================================================================
Index: packages/cups/cups-avahi-2-backend.patch
diff -u packages/cups/cups-avahi-2-backend.patch:1.3 packages/cups/cups-avahi-2-backend.patch:1.4
--- packages/cups/cups-avahi-2-backend.patch:1.3	Sun Feb  5 16:21:11 2012
+++ packages/cups/cups-avahi-2-backend.patch	Sat Jun 30 14:19:17 2012
@@ -1,6 +1,6 @@
-diff -up cups-1.5.0/backend/dnssd.c.avahi-2-backend cups-1.5.0/backend/dnssd.c
---- cups-1.5.0/backend/dnssd.c.avahi-2-backend	2011-08-05 15:04:46.182591844 +0100
-+++ cups-1.5.0/backend/dnssd.c	2011-08-05 15:05:13.868710181 +0100
+diff -up cups-1.5.3/backend/dnssd.c.avahi-2-backend cups-1.5.3/backend/dnssd.c
+--- cups-1.5.3/backend/dnssd.c.avahi-2-backend	2012-05-15 16:53:18.164774446 +0200
++++ cups-1.5.3/backend/dnssd.c	2012-05-15 17:09:07.684155704 +0200
 @@ -15,14 +15,21 @@
   *
   * Contents:
@@ -85,23 +85,24 @@
  static void		browse_callback(DNSServiceRef sdRef,
  			                DNSServiceFlags flags,
  				        uint32_t interfaceIndex,
-@@ -93,12 +131,6 @@ static void		browse_local_callback(DNSSe
- 					      const char *regtype,
+@@ -95,13 +133,6 @@ static void		browse_local_callback(DNSSe
  					      const char *replyDomain,
- 					      void *context);
+ 					      void *context)
+ 					      __attribute__((nonnull(1,5,6,7,8)));
 -static int		compare_devices(cups_device_t *a, cups_device_t *b);
 -static void		exec_backend(char **argv);
 -static cups_device_t	*get_device(cups_array_t *devices,
 -			            const char *serviceName,
 -			            const char *regtype,
--				    const char *replyDomain);
+-				    const char *replyDomain)
+-				    __attribute__((nonnull(1,2,3,4)));
  static void		query_callback(DNSServiceRef sdRef,
  			               DNSServiceFlags flags,
  				       uint32_t interfaceIndex,
-@@ -107,9 +139,118 @@ static void		query_callback(DNSServiceRe
- 				       uint16_t rrclass, uint16_t rdlen,
+@@ -111,10 +142,119 @@ static void		query_callback(DNSServiceRe
  				       const void *rdata, uint32_t ttl,
- 				       void *context);
+ 				       void *context)
+ 				       __attribute__((nonnull(1,5,9,11)));
 +#endif /* HAVE_DNSSD */
 +#ifdef HAVE_AVAHI
 +static void		avahi_client_callback (AvahiClient *client,
@@ -117,7 +118,6 @@
 +					       AvahiLookupResultFlags flags,
 +					       void *context);
 +#endif /* HAVE_AVAHI */
-+
 +static cups_device_t *	find_device (cups_array_t *devices,
 +				     cups_txt_records_t *txt,
 +				     cups_device_t *dkey);
@@ -126,9 +126,11 @@
 +static cups_device_t	*get_device(cups_array_t *devices,
 +			            const char *serviceName,
 +			            const char *regtype,
-+				    const char *replyDomain);
++				    const char *replyDomain)
++				    __attribute__((nonnull(1,2,3,4)));
  static void		sigterm_handler(int sig);
- static void		unquote(char *dst, const char *src, size_t dstsize);
+ static void		unquote(char *dst, const char *src, size_t dstsize)
+ 			    __attribute__((nonnull(1,2)));
  
 +#ifdef HAVE_AVAHI
 +static AvahiSimplePoll *simple_poll = NULL;
@@ -217,7 +219,7 @@
  
  /*
   * 'main()' - Browse for printers.
-@@ -120,6 +261,13 @@ main(int  argc,				/* I - Number of comm
+@@ -125,6 +265,13 @@ main(int  argc,				/* I - Number of comm
       char *argv[])			/* I - Command-line arguments */
  {
    const char	*name;			/* Backend name */
@@ -231,7 +233,7 @@
    DNSServiceRef	main_ref,		/* Main service reference */
  		fax_ipp_ref,		/* IPP fax service reference */
  		ipp_ref,		/* IPP service reference */
-@@ -133,12 +281,11 @@ main(int  argc,				/* I - Number of comm
+@@ -138,12 +285,11 @@ main(int  argc,				/* I - Number of comm
  		pdl_datastream_ref,	/* AppSocket service reference */
  		printer_ref,		/* LPD service reference */
  		riousbprint_ref;	/* Remote IO service reference */
@@ -249,7 +251,7 @@
  #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
    struct sigaction action;		/* Actions for POSIX signals */
  #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
-@@ -198,6 +345,49 @@ main(int  argc,				/* I - Number of comm
+@@ -203,6 +349,49 @@ main(int  argc,				/* I - Number of comm
    * Browse for different kinds of printers...
    */
  
@@ -299,7 +301,7 @@
    if (DNSServiceCreateConnection(&main_ref) != kDNSServiceErr_NoError)
    {
      perror("ERROR: Unable to create service connection");
-@@ -258,6 +448,7 @@ main(int  argc,				/* I - Number of comm
+@@ -263,6 +452,7 @@ main(int  argc,				/* I - Number of comm
    riousbprint_ref = main_ref;
    DNSServiceBrowse(&riousbprint_ref, kDNSServiceFlagsShareConnection, 0,
                     "_riousbprint._tcp", NULL, browse_callback, devices);
@@ -307,7 +309,7 @@
  
   /*
    * Loop until we are killed...
-@@ -265,6 +456,9 @@ main(int  argc,				/* I - Number of comm
+@@ -270,6 +460,9 @@ main(int  argc,				/* I - Number of comm
  
    while (!job_canceled)
    {
@@ -317,7 +319,7 @@
      FD_ZERO(&input);
      FD_SET(fd, &input);
  
-@@ -284,11 +478,35 @@ main(int  argc,				/* I - Number of comm
+@@ -289,11 +482,35 @@ main(int  argc,				/* I - Number of comm
      }
      else
      {
@@ -353,7 +355,7 @@
        cups_device_t *best;		/* Best matching device */
        char	device_uri[1024];	/* Device URI */
        int	count;			/* Number of queries */
-@@ -302,6 +520,7 @@ main(int  argc,				/* I - Number of comm
+@@ -307,6 +524,7 @@ main(int  argc,				/* I - Number of comm
          if (device->sent)
  	  sent ++;
  
@@ -361,7 +363,7 @@
          if (device->ref)
  	  count ++;
  
-@@ -333,14 +552,23 @@ main(int  argc,				/* I - Number of comm
+@@ -338,14 +556,23 @@ main(int  argc,				/* I - Number of comm
  	      count ++;
            }
  	}
@@ -386,7 +388,7 @@
  
            if (!best)
  	    best = device;
-@@ -401,6 +629,7 @@ main(int  argc,				/* I - Number of comm
+@@ -406,6 +633,7 @@ main(int  argc,				/* I - Number of comm
  }
  
  
@@ -394,7 +396,7 @@
  /*
   * 'browse_callback()' - Browse devices.
   */
-@@ -489,6 +718,7 @@ browse_local_callback(
+@@ -494,6 +722,7 @@ browse_local_callback(
  	  device->fullName);
    device->sent = 1;
  }
@@ -402,7 +404,7 @@
  
  
  /*
-@@ -569,6 +799,41 @@ exec_backend(char **argv)		/* I - Comman
+@@ -574,6 +803,41 @@ exec_backend(char **argv)		/* I - Comman
  
  
  /*
@@ -444,7 +446,7 @@
   * 'get_device()' - Create or update a device.
   */
  
-@@ -589,20 +854,7 @@ get_device(cups_array_t *devices,	/* I -
+@@ -594,20 +858,7 @@ get_device(cups_array_t *devices,	/* I -
    */
  
    key.name = (char *)serviceName;
@@ -466,7 +468,7 @@
  
    for (device = cupsArrayFind(devices, &key);
         device;
-@@ -622,8 +874,14 @@ get_device(cups_array_t *devices,	/* I -
+@@ -627,8 +878,14 @@ get_device(cups_array_t *devices,	/* I -
          free(device->domain);
  	device->domain = strdup(replyDomain);
  
@@ -481,7 +483,7 @@
  	free(device->fullName);
  	device->fullName = strdup(fullName);
        }
-@@ -643,6 +901,9 @@ get_device(cups_array_t *devices,	/* I -
+@@ -648,6 +905,9 @@ get_device(cups_array_t *devices,	/* I -
    device->domain   = strdup(replyDomain);
    device->type     = key.type;
    device->priority = 50;
@@ -491,7 +493,7 @@
  
    cupsArrayAdd(devices, device);
  
-@@ -650,13 +911,20 @@ get_device(cups_array_t *devices,	/* I -
+@@ -655,13 +915,20 @@ get_device(cups_array_t *devices,	/* I -
    * Set the "full name" of this service, which is used for queries...
    */
  
@@ -512,7 +514,7 @@
  /*
   * 'query_callback()' - Process query data.
   */
-@@ -680,7 +948,7 @@ query_callback(
+@@ -685,7 +952,7 @@ query_callback(
  		*ptr;			/* Pointer into string */
    cups_device_t	dkey,			/* Search key */
  		*device;		/* Device */
@@ -521,7 +523,7 @@
  
    fprintf(stderr, "DEBUG2: query_callback(sdRef=%p, flags=%x, "
                    "interfaceIndex=%d, errorCode=%d, fullName=\"%s\", "
-@@ -714,94 +982,233 @@ query_callback(
+@@ -719,94 +986,233 @@ query_callback(
    if ((ptr = strstr(name, "._")) != NULL)
      *ptr = '\0';
  
@@ -638,7 +640,8 @@
    else
 -    dkey.type = CUPS_DEVICE_RIOUSBPRINT;
 +    fprintf (stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", name);
-+
+ 
+-  for (device = cupsArrayFind(devices, &dkey);
 +  avahi_service_resolver_free (resolver);
 +}
 +
@@ -713,8 +716,7 @@
 +}
 +#endif /* HAVE_AVAHI */
 +
- 
--  for (device = cupsArrayFind(devices, &dkey);
++
 +/*
 + * 'find_device()' - Find a device from its name and domain.
 + */
@@ -817,7 +819,7 @@
  	{
  	 /*
  	  * Add USB device ID information...
-@@ -856,6 +1263,10 @@ query_callback(
+@@ -861,6 +1267,10 @@ query_callback(
  	  if (device->type == CUPS_DEVICE_PRINTER)
  	    device->sent = 1;
  	}
@@ -828,7 +830,7 @@
        }
  
        if (device->device_id)
-@@ -912,11 +1323,9 @@ query_callback(
+@@ -917,11 +1327,9 @@ query_callback(
      }
    }
  
@@ -841,9 +843,9 @@
  /*
   * 'sigterm_handler()' - Handle termination signals...
   */
-diff -up cups-1.5.0/cups/http-support.c.avahi-2-backend cups-1.5.0/cups/http-support.c
---- cups-1.5.0/cups/http-support.c.avahi-2-backend	2011-06-10 23:06:26.000000000 +0100
-+++ cups-1.5.0/cups/http-support.c	2011-08-05 15:05:13.870710117 +0100
+diff -up cups-1.5.3/cups/http-support.c.avahi-2-backend cups-1.5.3/cups/http-support.c
+--- cups-1.5.3/cups/http-support.c.avahi-2-backend	2012-02-15 02:06:12.000000000 +0100
++++ cups-1.5.3/cups/http-support.c	2012-05-15 17:04:51.045944634 +0200
 @@ -43,6 +43,10 @@
   *   http_copy_decode()   - Copy and decode a URI.
   *   http_copy_encode()   - Copy and encode a URI.
@@ -892,7 +894,7 @@
  
  /*
   * 'httpAssembleURI()' - Assemble a uniform resource identifier from its
-@@ -1431,6 +1458,9 @@ _httpResolveURI(
+@@ -1434,6 +1461,9 @@ _httpResolveURI(
  
    if (strstr(hostname, "._tcp"))
    {
@@ -902,7 +904,7 @@
  #ifdef HAVE_DNSSD
  #  ifdef WIN32
  #    pragma comment(lib, "dnssd.lib")
-@@ -1449,6 +1479,17 @@ _httpResolveURI(
+@@ -1452,6 +1482,17 @@ _httpResolveURI(
      fd_set		input_set;	/* Input set for select() */
      struct timeval	stimeout;	/* Timeout value for select() */
  #endif /* HAVE_POLL */
@@ -920,7 +922,7 @@
  
      if (options & _HTTP_RESOLVE_STDERR)
        fprintf(stderr, "DEBUG: Resolving \"%s\"...\n", hostname);
-@@ -1485,9 +1526,16 @@ _httpResolveURI(
+@@ -1488,9 +1529,16 @@ _httpResolveURI(
      if (domain)
        *domain++ = '\0';
  
@@ -937,7 +939,7 @@
      resolved_uri[0] = '\0';
  
      DEBUG_printf(("6_httpResolveURI: Resolving hostname=\"%s\", regtype=\"%s\", "
-@@ -1501,6 +1549,7 @@ _httpResolveURI(
+@@ -1504,6 +1552,7 @@ _httpResolveURI(
  
      uri = NULL;
  
@@ -945,7 +947,7 @@
      if (DNSServiceCreateConnection(&ref) == kDNSServiceErr_NoError)
      {
        localref = ref;
-@@ -1608,6 +1657,36 @@ _httpResolveURI(
+@@ -1611,6 +1660,36 @@ _httpResolveURI(
  
        DNSServiceRefDeallocate(ref);
      }
@@ -982,7 +984,7 @@
  
      if (options & _HTTP_RESOLVE_STDERR)
      {
-@@ -1619,13 +1698,13 @@ _httpResolveURI(
+@@ -1622,13 +1701,13 @@ _httpResolveURI(
        fputs("STATE: -connecting-to-device,offline-report\n", stderr);
      }
  
@@ -998,10 +1000,10 @@
  
      if ((options & _HTTP_RESOLVE_STDERR) && !uri)
        _cupsLangPrintFilter(stderr, "ERROR", _("Unable to find printer."));
-@@ -1895,6 +1974,116 @@ http_resolve_cb(
+@@ -1916,6 +1995,115 @@ http_resolve_cb(
+ }
  #endif /* HAVE_DNSSD */
  
- 
 +#ifdef HAVE_AVAHI
 +/*
 + * 'avahi_resolve_uri_client_cb()' - Avahi client callback for resolving URI.
@@ -1111,7 +1113,6 @@
 +}
 +#endif /* HAVE_AVAHI */
 +
-+
+ 
  /*
   * End of "$Id$".
-  */

================================================================
Index: packages/cups/cups-avahi-3-timeouts.patch
diff -u packages/cups/cups-avahi-3-timeouts.patch:1.1 packages/cups/cups-avahi-3-timeouts.patch:1.2
--- packages/cups/cups-avahi-3-timeouts.patch:1.1	Wed Dec 14 23:15:07 2011
+++ packages/cups/cups-avahi-3-timeouts.patch	Sat Jun 30 14:19:17 2012
@@ -1,6 +1,6 @@
-diff -up cups-1.5.0/scheduler/cupsd.h.avahi-3-timeouts cups-1.5.0/scheduler/cupsd.h
---- cups-1.5.0/scheduler/cupsd.h.avahi-3-timeouts	2011-05-11 23:17:34.000000000 +0100
-+++ cups-1.5.0/scheduler/cupsd.h	2011-08-05 15:06:13.570811440 +0100
+diff -up cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts cups-1.5.2/scheduler/cupsd.h
+--- cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts	2011-05-11 23:17:34.000000000 +0100
++++ cups-1.5.2/scheduler/cupsd.h	2012-03-14 15:06:36.509476983 +0000
 @@ -140,6 +140,15 @@ extern const char *cups_hstrerror(int);
  
  typedef void (*cupsd_selfunc_t)(void *data);
@@ -50,9 +50,9 @@
  
  /*
   * End of "$Id$".
-diff -up cups-1.5.0/scheduler/main.c.avahi-3-timeouts cups-1.5.0/scheduler/main.c
---- cups-1.5.0/scheduler/main.c.avahi-3-timeouts	2011-08-05 15:05:45.590700888 +0100
-+++ cups-1.5.0/scheduler/main.c	2011-08-05 15:06:13.572811372 +0100
+diff -up cups-1.5.2/scheduler/main.c.avahi-3-timeouts cups-1.5.2/scheduler/main.c
+--- cups-1.5.2/scheduler/main.c.avahi-3-timeouts	2012-03-14 15:04:17.655305548 +0000
++++ cups-1.5.2/scheduler/main.c	2012-03-14 15:06:36.511476986 +0000
 @@ -146,6 +146,10 @@ main(int  argc,				/* I - Number of comm
    int			launchd_idle_exit;
  					/* Idle exit on select timeout? */
@@ -96,7 +96,7 @@
  #ifndef __APPLE__
     /*
      * Update the network interfaces once a minute...
-@@ -1787,6 +1809,10 @@ select_timeout(int fds)			/* I - Number 
+@@ -1787,6 +1809,10 @@ select_timeout(int fds)			/* I - Number
    cupsd_job_t		*job;		/* Job information */
    cupsd_subscription_t	*sub;		/* Subscription information */
    const char		*why;		/* Debugging aid */
@@ -107,7 +107,7 @@
  
  
   /*
-@@ -1829,6 +1855,19 @@ select_timeout(int fds)			/* I - Number 
+@@ -1829,6 +1855,19 @@ select_timeout(int fds)			/* I - Number
    }
  #endif /* __APPLE__ */
  
@@ -116,8 +116,8 @@
 +  * See if there are any scheduled timed callbacks to run.
 +  */
 +
-+  tmo = cupsdNextTimeout (&tmo_delay);
-+  if (tmo)
++  if ((tmo = cupsdNextTimeout(&tmo_delay)) != NULL &&
++      (now + tmo_delay) < timeout)
 +  {
 +    timeout = tmo_delay;
 +    why = "run a timed callback";
@@ -127,9 +127,9 @@
   /*
    * Check whether we are accepting new connections...
    */
-diff -up cups-1.5.0/scheduler/Makefile.avahi-3-timeouts cups-1.5.0/scheduler/Makefile
---- cups-1.5.0/scheduler/Makefile.avahi-3-timeouts	2011-08-05 15:05:45.673698248 +0100
-+++ cups-1.5.0/scheduler/Makefile	2011-08-05 15:06:13.569811476 +0100
+diff -up cups-1.5.2/scheduler/Makefile.avahi-3-timeouts cups-1.5.2/scheduler/Makefile
+--- cups-1.5.2/scheduler/Makefile.avahi-3-timeouts	2012-03-14 15:04:17.685305586 +0000
++++ cups-1.5.2/scheduler/Makefile	2012-03-14 15:06:36.508476980 +0000
 @@ -39,7 +39,8 @@ CUPSDOBJS =	\
  		server.o \
  		statbuf.o \
@@ -140,22 +140,42 @@
  LIBOBJS =	\
  		filter.o \
  		mime.o \
-diff -up cups-1.5.0/scheduler/timeout.c.avahi-3-timeouts cups-1.5.0/scheduler/timeout.c
---- cups-1.5.0/scheduler/timeout.c.avahi-3-timeouts	2011-08-05 15:06:13.573811341 +0100
-+++ cups-1.5.0/scheduler/timeout.c	2011-08-05 15:06:13.573811341 +0100
-@@ -0,0 +1,195 @@
+diff -up cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts cups-1.5.2/scheduler/timeout.c
+--- cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts	2012-03-14 15:06:36.552477037 +0000
++++ cups-1.5.2/scheduler/timeout.c	2012-03-14 15:06:36.552477037 +0000
+@@ -0,0 +1,235 @@
 +/*
 + * "$Id$"
 + *
 + *   Timeout functions for the Common UNIX Printing System (CUPS).
 + *
-+ *   Copyright (C) 2010 Red Hat, Inc.
++ *   Copyright (C) 2010, 2011 Red Hat, Inc.
 + *   Authors:
 + *     Tim Waugh <twaugh at redhat.com>
 + *
-+ *   Distribution and use rights are outlined in the file "LICENSE.txt"
-+ *   which should have been included with this file.  If this file is
-+ *   file is missing or damaged, see the license at "http://www.cups.org/".
++ *   Redistribution and use in source and binary forms, with or without
++ *   modification, are permitted provided that the following conditions
++ *   are met:
++ *
++ *   Redistributions of source code must retain the above copyright
++ *   notice, this list of conditions and the following disclaimer.
++ *
++ *   Redistributions in binary form must reproduce the above copyright
++ *   notice, this list of conditions and the following disclaimer in the
++ *   documentation and/or other materials provided with the distribution.
++ *
++ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
++ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
++ *   COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
++ *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ *   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ *   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
++ *   OF THE POSSIBILITY OF SUCH DAMAGE.
 + *
 + * Contents:
 + *
@@ -203,17 +223,37 @@
 + */
 +
 +static int
++compare_addrs (void *p0, void *p1)
++{
++  if (p0 == p1)
++    return (0);
++  if (p0 < p1)
++    return (-1);
++  return (1);
++}
++
++static int
 +compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1)
 +{
++  int addrsdiff = compare_addrs (p0, p1);
++  int tvdiff;
++
++  if (addrsdiff == 0)
++    return (0);
++
 +  if (!p0->enabled || !p1->enabled)
 +  {
 +    if (!p0->enabled && !p1->enabled)
-+      return (0);
++      return (addrsdiff);
 +
 +    return (p0->enabled ? -1 : 1);
 +  }
 +
-+  return (avahi_timeval_compare (&p0->when, &p1->when));
++  tvdiff = avahi_timeval_compare (&p0->when, &p1->when);
++  if (tvdiff != 0)
++    return (tvdiff);
++
++  return (addrsdiff);
 +}
 +
 +

================================================================
Index: packages/cups/cups-avahi-4-poll.patch
diff -u packages/cups/cups-avahi-4-poll.patch:1.1 packages/cups/cups-avahi-4-poll.patch:1.2
--- packages/cups/cups-avahi-4-poll.patch:1.1	Wed Dec 14 23:15:07 2011
+++ packages/cups/cups-avahi-4-poll.patch	Sat Jun 30 14:19:17 2012
@@ -1,19 +1,39 @@
-diff -up cups-1.5.0/scheduler/avahi.c.avahi-4-poll cups-1.5.0/scheduler/avahi.c
---- cups-1.5.0/scheduler/avahi.c.avahi-4-poll	2011-08-05 15:07:09.570033486 +0100
-+++ cups-1.5.0/scheduler/avahi.c	2011-08-05 15:07:09.570033486 +0100
-@@ -0,0 +1,445 @@
+diff -up cups-1.5.2/scheduler/avahi.c.avahi-4-poll cups-1.5.2/scheduler/avahi.c
+--- cups-1.5.2/scheduler/avahi.c.avahi-4-poll	2012-03-14 15:07:29.477542381 +0000
++++ cups-1.5.2/scheduler/avahi.c	2012-03-14 15:07:29.477542381 +0000
+@@ -0,0 +1,441 @@
 +/*
 + * "$Id$"
 + *
 + *   Avahi poll implementation for the CUPS scheduler.
 + *
-+ *   Copyright (C) 2010 Red Hat, Inc.
++ *   Copyright (C) 2010, 2011 Red Hat, Inc.
 + *   Authors:
 + *    Tim Waugh <twaugh at redhat.com>
 + *
-+ *   Distribution and use rights are outlined in the file "LICENSE.txt"
-+ *   "LICENSE" which should have been included with this file.  If this
-+ *   file is missing or damaged, see the license at "http://www.cups.org/".
++ *   Redistribution and use in source and binary forms, with or without
++ *   modification, are permitted provided that the following conditions
++ *   are met:
++ *
++ *   Redistributions of source code must retain the above copyright
++ *   notice, this list of conditions and the following disclaimer.
++ *
++ *   Redistributions in binary form must reproduce the above copyright
++ *   notice, this list of conditions and the following disclaimer in the
++ *   documentation and/or other materials provided with the distribution.
++ *
++ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
++ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
++ *   COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
++ *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ *   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ *   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ *   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ *   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
++ *   OF THE POSSIBILITY OF SUCH DAMAGE.
 + *
 + * Contents:
 + *
@@ -29,7 +49,6 @@
 + *   timeout_update()      - Update the expiration time for a timeout
 + *   timeout_free()        - Free a timeout
 + *   compare_watched_fds() - Compare watched file descriptors for array sorting
-+ *   compare_timeouts()    - Compare timeouts for array sorting
 + *   avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/packages/cups/cups-avahi-1-config.patch?r1=1.1&r2=1.2
    http://cvs.pld-linux.org/packages/cups/cups-avahi-2-backend.patch?r1=1.3&r2=1.4
    http://cvs.pld-linux.org/packages/cups/cups-avahi-3-timeouts.patch?r1=1.1&r2=1.2
    http://cvs.pld-linux.org/packages/cups/cups-avahi-4-poll.patch?r1=1.1&r2=1.2
    http://cvs.pld-linux.org/packages/cups/cups-avahi-5-services.patch?r1=1.3&r2=1.4
    http://cvs.pld-linux.org/packages/cups/cups.spec?r1=1.330&r2=1.331



More information about the pld-cvs-commit mailing list