[lfs-patches] r2886 - trunk/cups

pierre at higgs.linuxfromscratch.org pierre at higgs.linuxfromscratch.org
Thu May 1 00:26:12 PDT 2014


Author: pierre
Date: Thu May  1 00:26:12 2014
New Revision: 2886

Log:
Patch for disabling the dependency on avahi for cups

Added:
   trunk/cups/cups-1.7.2-avahi_optional-1.patch

Added: trunk/cups/cups-1.7.2-avahi_optional-1.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/cups/cups-1.7.2-avahi_optional-1.patch	Thu May  1 00:26:12 2014	(r2886)
@@ -0,0 +1,186 @@
+Submitted By:            Pierre Labastie <pierre at higgs dot linuxfromscratch dot com>
+Date:                    2014-04-30
+Initial Package Version: 1.7.2
+Upstream Status:         Submitted
+Origin:                  Ferran Selles in cups bug tracker
+Description:             Remove dependency on avahi for CUPS
+
+--- a/scheduler/dirsvc.c	2014-04-24 16:45:32.000000000 +0200
++++ b/scheduler/dirsvc.c	2014-04-24 16:21:44.000000000 +0200
+@@ -50,6 +50,9 @@ static int		get_hostconfig(const char *n
+ static void		update_lpd(int onoff);
+ static void		update_smb(int onoff);
+ 
++static void		deregister_all_printers(int from_callback);
++static void		register_all_printers(int from_callback);
++
+ 
+ #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
+ #  ifdef __APPLE__
+@@ -60,12 +63,10 @@ static cupsd_txt_t	dnssdBuildTxtRecord(c
+ #  ifdef HAVE_AVAHI
+ static void		dnssdClientCallback(AvahiClient *c, AvahiClientState state, void *userdata);
+ #  endif /* HAVE_AVAHI */
+-static void		dnssdDeregisterAllPrinters(int from_callback);
+ static void		dnssdDeregisterInstance(cupsd_srv_t *srv, int from_callback);
+ static void		dnssdDeregisterPrinter(cupsd_printer_t *p, int clear_name, int from_callback);
+ static const char	*dnssdErrorString(int error);
+ static void		dnssdFreeTxtRecord(cupsd_txt_t *txt);
+-static void		dnssdRegisterAllPrinters(int from_callback);
+ #  ifdef HAVE_DNSSD
+ static void		dnssdRegisterCallback(DNSServiceRef sdRef,
+ 					      DNSServiceFlags flags,
+@@ -241,7 +242,7 @@ cupsdStartBrowsing(void)
+   * Register the individual printers
+   */
+ 
+-  dnssdRegisterAllPrinters(0);
++  register_all_printers(0);
+ }
+ 
+ 
+@@ -259,7 +260,7 @@ cupsdStopBrowsing(void)
+   * De-register the individual printers
+   */
+ 
+-  dnssdDeregisterAllPrinters(0);
++  deregister_all_printers(0);
+ 
+  /*
+   * Shut down browsing sockets...
+@@ -540,7 +541,7 @@ dnssdClientCallback(
+ 	* Register the individual printers
+ 	*/
+ 
+-	dnssdRegisterAllPrinters(1);
++	register_all_printers(1);
+ 	break;
+ 
+     case AVAHI_CLIENT_FAILURE:
+@@ -552,7 +553,7 @@ dnssdClientCallback(
+ 	  * Unregister everything and close the client...
+ 	  */
+ 
+-	  dnssdDeregisterAllPrinters(1);
++	  deregister_all_printers(1);
+ 	  dnssdDeregisterInstance(&WebIFSrv, 1);
+ 	  avahi_client_free(DNSSDClient);
+ 	  DNSSDClient = NULL;
+@@ -592,28 +593,6 @@ dnssdClientCallback(
+ 
+ 
+ /*
+- * 'dnssdDeregisterAllPrinters()' - Deregister all printers.
+- */
+-
+-static void
+-dnssdDeregisterAllPrinters(
+-    int             from_callback)	/* I - Deregistering because of callback? */
+-{
+-  cupsd_printer_t	*p;		/* Current printer */
+-
+-
+-  if (!DNSSDMaster)
+-    return;
+-
+-  for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+-       p;
+-       p = (cupsd_printer_t *)cupsArrayNext(Printers))
+-    if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
+-      dnssdDeregisterPrinter(p, 1, from_callback);
+-}
+-
+-
+-/*
+  * 'dnssdDeregisterInstance()' - Deregister a DNS-SD service instance.
+  */
+ 
+@@ -819,27 +798,6 @@ dnssdFreeTxtRecord(cupsd_txt_t *txt)	/* 
+ 
+ 
+ /*
+- * 'dnssdRegisterAllPrinters()' - Register all printers.
+- */
+-
+-static void
+-dnssdRegisterAllPrinters(int from_callback)	/* I - Called from callback? */
+-{
+-  cupsd_printer_t	*p;			/* Current printer */
+-
+-
+-  if (!DNSSDMaster)
+-    return;
+-
+-  for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+-       p;
+-       p = (cupsd_printer_t *)cupsArrayNext(Printers))
+-    if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
+-      dnssdRegisterPrinter(p, from_callback);
+-}
+-
+-
+-/*
+  * 'dnssdRegisterCallback()' - DNSServiceRegister callback.
+  */
+ 
+@@ -1775,5 +1733,60 @@ update_smb(int onoff)			/* I - 1 = turn 
+ 
+ 
+ /*
++ * 'deregister_all_printers()' - Deregister all printers.
++ */
++
++static void
++deregister_all_printers(
++    int             from_callback)	/* I - Deregistering because of callback? */
++{
++  cupsd_printer_t	*p;		/* Current printer */
++
++
++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
++  if (!DNSSDMaster)
++    return;
++#endif /* HAVE_DNSSD || HAVE_AVAHI */
++
++  for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
++       p;
++       p = (cupsd_printer_t *)cupsArrayNext(Printers))
++    if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
++      dnssdDeregisterPrinter(p, 1, from_callback);
++#else
++      cupsdDeregisterPrinter(p, 1);
++#endif /* HAVE_DNSSD || HAVE_AVAHI */
++}
++
++
++/*
++ * 'register_all_printers()' - Register all printers.
++ */
++
++static void
++register_all_printers(int from_callback)	/* I - Called from callback? */
++{
++  cupsd_printer_t	*p;			/* Current printer */
++
++
++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
++  if (!DNSSDMaster)
++    return;
++#endif /* HAVE_DNSSD || HAVE_AVAHI */
++
++  for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
++       p;
++       p = (cupsd_printer_t *)cupsArrayNext(Printers))
++    if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
++#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
++      dnssdRegisterPrinter(p, from_callback);
++#else
++      cupsdRegisterPrinter(p);
++#endif /* HAVE_DNSSD || HAVE_AVAHI */
++}
++
++
++/*
+  * End of "$Id: dirsvc.c 11688 2014-03-05 21:11:32Z msweet $".
+  */


More information about the patches mailing list