[csw-devel] SF.net SVN: gar:[6304] csw/mgar/pkg/cups/branches/cups-1.4

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Sep 14 17:32:28 CEST 2009


Revision: 6304
          http://gar.svn.sourceforge.net/gar/?rev=6304&view=rev
Author:   wahwah
Date:     2009-09-14 15:32:28 +0000 (Mon, 14 Sep 2009)

Log Message:
-----------
cups: Experimental patches with reference counts.

Modified Paths:
--------------
    csw/mgar/pkg/cups/branches/cups-1.4/Makefile
    csw/mgar/pkg/cups/branches/cups-1.4/checksums

Added Paths:
-----------
    csw/mgar/pkg/cups/branches/cups-1.4/files/0001-cswcups-for-service-name.patch
    csw/mgar/pkg/cups/branches/cups-1.4/files/0002-Adding-the-refcount-member-to-mime_type_t.patch
    csw/mgar/pkg/cups/branches/cups-1.4/files/0003-Reference-counting-for-printers-only.patch

Removed Paths:
-------------
    csw/mgar/pkg/cups/branches/cups-1.4/files/0001-Makefile.patch

Modified: csw/mgar/pkg/cups/branches/cups-1.4/Makefile
===================================================================
--- csw/mgar/pkg/cups/branches/cups-1.4/Makefile	2009-09-14 08:26:35 UTC (rev 6303)
+++ csw/mgar/pkg/cups/branches/cups-1.4/Makefile	2009-09-14 15:32:28 UTC (rev 6304)
@@ -25,7 +25,9 @@
 FULL_MIRRORS = $(foreach S,$(CUPS_MIRRORS),$(S)/$(GARNAME)/$(GARVERSION)/)
 MASTER_SITES += $(FULL_MIRRORS)
 
-PATCHFILES = 0001-Makefile.patch
+PATCHFILES  = 0001-cswcups-for-service-name.patch
+PATCHFILES += 0002-Adding-the-refcount-member-to-mime_type_t.patch
+PATCHFILES += 0003-Reference-counting-for-printers-only.patch
 DISTFILES  = cups-$(GARVERSION)-source.tar.bz2 $(PATCHFILES)
 DISTFILES += CSWcupsclient.preinstall
 DISTFILES += CSWcupsd.preinstall

Modified: csw/mgar/pkg/cups/branches/cups-1.4/checksums
===================================================================
--- csw/mgar/pkg/cups/branches/cups-1.4/checksums	2009-09-14 08:26:35 UTC (rev 6303)
+++ csw/mgar/pkg/cups/branches/cups-1.4/checksums	2009-09-14 15:32:28 UTC (rev 6304)
@@ -1,4 +1,6 @@
-682e10ff0ab0e094c3de2061369038bc  download/0001-Makefile.patch
+1e5e54a2b503cfdeeda1b683bcccab83  download/0001-cswcups-for-service-name.patch
+0da4ea6bf72d61adfc4316a738b90ab5  download/0002-Adding-the-refcount-member-to-mime_type_t.patch
+a80b8543633e2f9b3b1e531ac2289306  download/0003-Reference-counting-for-printers-only.patch
 8418cf872043eada2d46c8db6e6451c0  download/CSWcupsclient.preinstall
 ca7718998e56c320c08a77cfefe046f6  download/CSWcupsd.postremove
 8418cf872043eada2d46c8db6e6451c0  download/CSWcupsd.preinstall

Deleted: csw/mgar/pkg/cups/branches/cups-1.4/files/0001-Makefile.patch
===================================================================
--- csw/mgar/pkg/cups/branches/cups-1.4/files/0001-Makefile.patch	2009-09-14 08:26:35 UTC (rev 6303)
+++ csw/mgar/pkg/cups/branches/cups-1.4/files/0001-Makefile.patch	2009-09-14 15:32:28 UTC (rev 6304)
@@ -1,72 +0,0 @@
-From 77ba01db2d7f7b8585bb05bb8652aedf09860bd5 Mon Sep 17 00:00:00 2001
-From: Maciej Blizinski <maciej at opencsw.org>
-Date: Sat, 5 Sep 2009 03:31:57 +0200
-Subject: [PATCH] Makefile
-
----
- Makefile        |   12 ++++++------
- locale/Makefile |    3 ++-
- 2 files changed, 8 insertions(+), 7 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 91be6e5..a1ff6f8 100644
---- a/Makefile
-+++ b/Makefile
-@@ -178,18 +178,18 @@ install-data:
- 	if test "x$(INITDIR)" != x; then \
- 		echo Installing init scripts...; \
- 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
--		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
-+		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cswcups; \
- 		for level in $(RCLEVELS); do \
- 			$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
--			$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
-+			$(LN) ../init.d/cswcups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
- 			if test `uname` = HP-UX; then \
- 				level=`expr $$level - 1`; \
- 				$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
- 			fi; \
--			$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
-+			$(LN) ../init.d/cswcups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
- 		done; \
- 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
--		$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
-+		$(LN) ../init.d/cswcups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
- 	fi
- 	if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
- 		$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
-@@ -227,7 +227,7 @@ install-data:
- 		$(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
- 	fi
- 	if test "x$(MENUDIR)" != x; then \
--		echo Installing desktop menu...; \
-+		echo Installing desktop menu into $(BUILDROOT)$(MENUDIR)...; \
- 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
- 		$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
- 	fi
-@@ -290,7 +290,7 @@ uninstall:
- 	-$(RMDIR) $(BINDIR)
- 	echo Uninstalling startup script...
- 	if test "x$(INITDIR)" != x; then \
--		$(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
-+		$(RM) $(BUILDROOT)$(INITDIR)/init.d/cswcups; \
- 		$(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
- 		$(RM)  $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
- 		$(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
-diff --git a/locale/Makefile b/locale/Makefile
-index 6241b66..f76b8bc 100644
---- a/locale/Makefile
-+++ b/locale/Makefile
-@@ -75,7 +75,8 @@ install-languages:
- 	for loc in $(LANGUAGES) ; do \
- 		if test -f cups_$$loc.po; then \
- 			$(INSTALL_DIR) -m 755 $(LOCALEDIR)/$$loc ; \
--			$(INSTALL_DATA) cups_$$loc.po $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
-+			$(INSTALL_DIR) -m 755 $(LOCALEDIR)/$$loc/LC_MESSAGES ; \
-+			$(INSTALL_DATA) cups_$$loc.po $(LOCALEDIR)/$$loc/LC_MESSAGES/cups_$$loc.po ; \
- 		fi ; \
- 	done
- 
--- 
-1.6.3.2
-

Added: csw/mgar/pkg/cups/branches/cups-1.4/files/0001-cswcups-for-service-name.patch
===================================================================
--- csw/mgar/pkg/cups/branches/cups-1.4/files/0001-cswcups-for-service-name.patch	                        (rev 0)
+++ csw/mgar/pkg/cups/branches/cups-1.4/files/0001-cswcups-for-service-name.patch	2009-09-14 15:32:28 UTC (rev 6304)
@@ -0,0 +1,72 @@
+From 7ef5a09e7257782a5f8b4d9bcf681a399ef82996 Mon Sep 17 00:00:00 2001
+From: Super-User <root at cabbage.dub.corp.google.com>
+Date: Wed, 9 Sep 2009 16:41:17 +0100
+Subject: [PATCH 1/3] cswcups for service name
+
+---
+ Makefile        |   12 ++++++------
+ locale/Makefile |    3 ++-
+ 2 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 91be6e5..a1ff6f8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -178,18 +178,18 @@ install-data:
+ 	if test "x$(INITDIR)" != x; then \
+ 		echo Installing init scripts...; \
+ 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
+-		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
++		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cswcups; \
+ 		for level in $(RCLEVELS); do \
+ 			$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
+-			$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
++			$(LN) ../init.d/cswcups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
+ 			if test `uname` = HP-UX; then \
+ 				level=`expr $$level - 1`; \
+ 				$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
+ 			fi; \
+-			$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
++			$(LN) ../init.d/cswcups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
+ 		done; \
+ 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
+-		$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
++		$(LN) ../init.d/cswcups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
+ 	fi
+ 	if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
+ 		$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
+@@ -227,7 +227,7 @@ install-data:
+ 		$(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
+ 	fi
+ 	if test "x$(MENUDIR)" != x; then \
+-		echo Installing desktop menu...; \
++		echo Installing desktop menu into $(BUILDROOT)$(MENUDIR)...; \
+ 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
+ 		$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
+ 	fi
+@@ -290,7 +290,7 @@ uninstall:
+ 	-$(RMDIR) $(BINDIR)
+ 	echo Uninstalling startup script...
+ 	if test "x$(INITDIR)" != x; then \
+-		$(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
++		$(RM) $(BUILDROOT)$(INITDIR)/init.d/cswcups; \
+ 		$(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
+ 		$(RM)  $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
+ 		$(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
+diff --git a/locale/Makefile b/locale/Makefile
+index 6241b66..f76b8bc 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -75,7 +75,8 @@ install-languages:
+ 	for loc in $(LANGUAGES) ; do \
+ 		if test -f cups_$$loc.po; then \
+ 			$(INSTALL_DIR) -m 755 $(LOCALEDIR)/$$loc ; \
+-			$(INSTALL_DATA) cups_$$loc.po $(LOCALEDIR)/$$loc/cups_$$loc.po ; \
++			$(INSTALL_DIR) -m 755 $(LOCALEDIR)/$$loc/LC_MESSAGES ; \
++			$(INSTALL_DATA) cups_$$loc.po $(LOCALEDIR)/$$loc/LC_MESSAGES/cups_$$loc.po ; \
+ 		fi ; \
+ 	done
+ 
+-- 
+1.6.3.2
+

Added: csw/mgar/pkg/cups/branches/cups-1.4/files/0002-Adding-the-refcount-member-to-mime_type_t.patch
===================================================================
--- csw/mgar/pkg/cups/branches/cups-1.4/files/0002-Adding-the-refcount-member-to-mime_type_t.patch	                        (rev 0)
+++ csw/mgar/pkg/cups/branches/cups-1.4/files/0002-Adding-the-refcount-member-to-mime_type_t.patch	2009-09-14 15:32:28 UTC (rev 6304)
@@ -0,0 +1,24 @@
+From ee9340922a5a998e05b2ec123233f2bbf57a84a3 Mon Sep 17 00:00:00 2001
+From: Super-User <root at cabbage.dub.corp.google.com>
+Date: Wed, 9 Sep 2009 19:33:00 +0100
+Subject: [PATCH 2/3] Adding the refcount member to mime_type_t
+
+---
+ scheduler/mime.h |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/scheduler/mime.h b/scheduler/mime.h
+index 0194964..4bd64c2 100644
+--- a/scheduler/mime.h
++++ b/scheduler/mime.h
+@@ -85,6 +85,7 @@ typedef struct _mime_magic_s		/**** MIME Magic Data ****/
+ 
+ typedef struct _mime_type_s		/**** MIME Type Data ****/
+ {
++  int           refcount;               /* To allow sharing of this struct */
+   mime_magic_t	*rules;			/* Rules used to detect this type */
+   int		priority;		/* Priority of this type */
+   char		super[MIME_MAX_SUPER],	/* Super-type name ("image", "application", etc.) */
+-- 
+1.6.3.2
+

Added: csw/mgar/pkg/cups/branches/cups-1.4/files/0003-Reference-counting-for-printers-only.patch
===================================================================
--- csw/mgar/pkg/cups/branches/cups-1.4/files/0003-Reference-counting-for-printers-only.patch	                        (rev 0)
+++ csw/mgar/pkg/cups/branches/cups-1.4/files/0003-Reference-counting-for-printers-only.patch	2009-09-14 15:32:28 UTC (rev 6304)
@@ -0,0 +1,56 @@
+From b22d9f6339a2d367dd5493f8fb0e06041b26d80a Mon Sep 17 00:00:00 2001
+From: Super-User <root at cabbage.dub.corp.google.com>
+Date: Wed, 9 Sep 2009 19:52:18 +0100
+Subject: [PATCH 3/3] Reference counting for printers only.
+
+---
+ scheduler/mime.c     |    7 +++++++
+ scheduler/printers.c |    1 +
+ scheduler/type.c     |    1 +
+ 3 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/scheduler/mime.c b/scheduler/mime.c
+index 890f2ea..1cabf64 100644
+--- a/scheduler/mime.c
++++ b/scheduler/mime.c
+@@ -156,6 +156,13 @@ mimeDeleteType(mime_t      *mime,	/* I - MIME database */
+   if (!mime || !mt)
+     return;
+ 
++  mt->refcount--;
++  if (mt->refcount) {
++    /*
++     * Other references to this instance exist, not removing.
++     */
++    return;
++  }
+   cupsArrayRemove(mime->types, mt);
+ 
+   delete_rules(mt->rules);
+diff --git a/scheduler/printers.c b/scheduler/printers.c
+index 1430946..629b86d 100644
+--- a/scheduler/printers.c
++++ b/scheduler/printers.c
+@@ -127,6 +127,7 @@ cupsdAddPrinter(const char *name)	/* I - Name of printer */
+   p->accepting  = 0;
+   p->shared     = DefaultShared;
+   p->filetype   = mimeAddType(MimeDatabase, "printer", name);
++  p->filetype->refcount++;
+ 
+   cupsdSetString(&p->job_sheets[0], "none");
+   cupsdSetString(&p->job_sheets[1], "none");
+diff --git a/scheduler/type.c b/scheduler/type.c
+index 6443506..faf4381 100644
+--- a/scheduler/type.c
++++ b/scheduler/type.c
+@@ -124,6 +124,7 @@ mimeAddType(mime_t     *mime,		/* I - MIME database */
+                         strlen(type) + 1)) == NULL)
+     return (NULL);
+ 
++  temp->refcount = 0; /* Callers are responsible for incrementing the counter */
+   strlcpy(temp->super, super, sizeof(temp->super));
+   strcpy(temp->type, type);		/* Safe: temp->type is allocated */
+   temp->priority = 100;
+-- 
+1.6.3.2
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list