Revision: 15414 http://gar.svn.sourceforge.net/gar/?rev=15414&view=rev Author: dmichelsen Date: 2011-08-23 15:35:33 +0000 (Tue, 23 Aug 2011)
Log Message: ----------- dbus: Intermediate commit, working on bringing patches upstream Modified Paths: -------------- csw/mgar/pkg/dbus/trunk/Makefile csw/mgar/pkg/dbus/trunk/files/dbus-sysdeps-unix.c.diff Added Paths: ----------- csw/mgar/pkg/dbus/trunk/files/0002-Add-missing-inclusion-of-inttypes.h.patch csw/mgar/pkg/dbus/trunk/files/attachment-50480.patch csw/mgar/pkg/dbus/trunk/files/attachment.cgi?id=50498 Modified: csw/mgar/pkg/dbus/trunk/Makefile =================================================================== --- csw/mgar/pkg/dbus/trunk/Makefile 2011-08-23 14:55:43 UTC (rev 15413) +++ csw/mgar/pkg/dbus/trunk/Makefile 2011-08-23 15:35:33 UTC (rev 15414) @@ -1,10 +1,12 @@ -# TBD: -# - test position of pidfile in compilation and cswdbus -# - cleanup of /usr/share, /usr/local occurrences +# $Id: Makefile 15327 2011-08-12 21:35:23Z dmichelsen $ +# TODO (release-critical prefixed with !, non release-critical with *) +# +# ! test position of pidfile in compilation and cswdbus +# ! cleanup of /usr/share, /usr/local occurrences -NAME = dbus -VERSION = 1.5.6 -CATEGORIES = lib +NAME = dbus +VERSION = 1.5.6 +CATEGORIES = lib DESCRIPTION = DBus Message Bus System define BLURB @@ -28,10 +30,22 @@ DISTFILES += cswusergroup DISTFILES += cswdbus -PATCHFILES += dbus-sysdeps-unix.c.diff -PATCHFILES += dbus-sysdeps.h.diff +# Use this patch until this issue is fixed: +# http://bugs.freedesktop.org/show_bug.cgi?id=40235 +#PATCHFILES += dbus-sysdeps-unix.c.diff + +#PATCHFILES += dbus-sysdeps.h.diff + +# Use patch until this is fixed: +# http://bugs.freedesktop.org/show_bug.cgi?id=40313 +PATCHFILES += 0002-Add-missing-inclusion-of-inttypes.h.patch + +# Use this custom-patch unless this is fixed: +# http://bugs.freedesktop.org/show_bug.cgi?id=39987 PATCHFILES += 0001-Use-LOG_PERROR-only-when-available.patch +PATCHFILES += attachment-50480.patch + PACKAGES += CSWdbus CATALOGNAME_CSWdbus = dbus SPKG_DESC_CSWdbus = $(DESCRIPTION) Added: csw/mgar/pkg/dbus/trunk/files/0002-Add-missing-inclusion-of-inttypes.h.patch =================================================================== --- csw/mgar/pkg/dbus/trunk/files/0002-Add-missing-inclusion-of-inttypes.h.patch (rev 0) +++ csw/mgar/pkg/dbus/trunk/files/0002-Add-missing-inclusion-of-inttypes.h.patch 2011-08-23 15:35:33 UTC (rev 15414) @@ -0,0 +1,27 @@ +From e54601c6645a7e6041c808866029866990d27f69 Mon Sep 17 00:00:00 2001 +From: Dagobert Michelsen <d...@opencsw.org> +Date: Tue, 23 Aug 2011 16:52:46 +0200 +Subject: [PATCH] Add missing inclusion of inttypes.h + +--- + dbus/dbus-sysdeps.h | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h +index f66efaa..f8438f4 100644 +--- a/dbus/dbus-sysdeps.h ++++ b/dbus/dbus-sysdeps.h +@@ -31,6 +31,10 @@ + #include <stdint.h> + #endif + ++#ifdef HAVE_INTTYPES_H ++#include <inttypes.h> ++#endif ++ + #include <dbus/dbus-errors.h> + #include <dbus/dbus-file.h> + #include <dbus/dbus-string.h> +-- +1.7.6 + Added: csw/mgar/pkg/dbus/trunk/files/attachment-50480.patch =================================================================== --- csw/mgar/pkg/dbus/trunk/files/attachment-50480.patch (rev 0) +++ csw/mgar/pkg/dbus/trunk/files/attachment-50480.patch 2011-08-23 15:35:33 UTC (rev 15414) @@ -0,0 +1,57 @@ +From 66e0c1525bca0830ea8e9f420927d18f4676e46f Mon Sep 17 00:00:00 2001 +From: Simon McVittie <simon.mcvit...@collabora.co.uk> +Date: Tue, 23 Aug 2011 12:05:00 +0100 +Subject: [PATCH] On Solaris, define CMSG_ALIGN, CMSG_LEN, CMSG_SPACE if + undefined + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40235 +--- + dbus/dbus-sysdeps-unix.c | 32 ++++++++++++++++++++++++++++++++ + 1 files changed, 32 insertions(+), 0 deletions(-) + +diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c +index e69f3b5..171977d 100644 +--- a/dbus/dbus-sysdeps-unix.c ++++ b/dbus/dbus-sysdeps-unix.c +@@ -90,6 +90,38 @@ + #define socklen_t int + #endif + ++#if defined (__sun) || defined (__sun__) ++/* ++ * CMS_SPACE etc. definitions for Solaris < 10, based on ++ * http://mailman.videolan.org/pipermail/vlc-devel/2006-May/024402.html ++ * via ++ * http://wiki.opencsw.org/porting-faq#toc10 ++ * ++ * These are only redefined for Solaris, for now: if your OS needs these too, ++ * please file a bug. (Or preferably, improve your OS so they're not needed.) ++ */ ++ ++# ifndef CMSG_ALIGN ++# ifdef __sun__ ++# define CMSG_ALIGN(len) _CMSG_DATA_ALIGN (len) ++# else ++ /* aligning to sizeof (long) is assumed to be portable (fd.o#40235) */ ++# define CMSG_ALIGN(len) (((len) + sizeof (long) - 1) & \ ++ ~(sizeof (long) - 1)) ++# endif ++# endif ++ ++# ifndef CMSG_SPACE ++# define CMSG_SPACE(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + \ ++ CMSG_ALIGN (len)) ++# endif ++ ++# ifndef CMSG_LEN ++# define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) ++# endif ++ ++#endif /* Solaris */ ++ + static dbus_bool_t + _dbus_open_socket (int *fd_p, + int domain, +-- +1.7.5.4 + Added: csw/mgar/pkg/dbus/trunk/files/attachment.cgi?id=50498 =================================================================== --- csw/mgar/pkg/dbus/trunk/files/attachment.cgi?id=50498 (rev 0) +++ csw/mgar/pkg/dbus/trunk/files/attachment.cgi?id=50498 2011-08-23 15:35:33 UTC (rev 15414) @@ -0,0 +1,143 @@ +From bf6bd403c7d74b2bc9e7bef53bce3d69d47870ac Mon Sep 17 00:00:00 2001 +From: Simon McVittie <simon.mcvit...@collabora.co.uk> +Date: Tue, 23 Aug 2011 16:14:21 +0100 +Subject: [PATCH 2/2] Add a semi-automatic test for _dbus_system_log + +--- + test/Makefile.am | 5 ++ + test/internals/syslog.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 105 insertions(+), 0 deletions(-) + create mode 100644 test/internals/syslog.c + +diff --git a/test/Makefile.am b/test/Makefile.am +index e5fd756..54ba823 100644 +--- a/test/Makefile.am ++++ b/test/Makefile.am +@@ -101,6 +101,10 @@ test_refs_SOURCES = internals/refs.c + test_refs_CPPFLAGS = -DDBUS_STATIC_BUILD $(GLIB_CFLAGS) + test_refs_LDADD = libdbus-testutils.la $(GLIB_LIBS) $(TEST_LIBS) + ++test_syslog_SOURCES = internals/syslog.c ++test_syslog_CPPFLAGS = -DDBUS_STATIC_BUILD $(GLIB_CFLAGS) ++test_syslog_LDADD = libdbus-testutils.la $(GLIB_LIBS) $(TEST_LIBS) ++ + EXTRA_DIST = dbus-test-runner + + testexecdir = $(libdir)/dbus-1.0/test +@@ -114,6 +118,7 @@ installable_tests = \ + test-marshal \ + test-refs \ + test-relay \ ++ test-syslog \ + $(NULL) + + installcheck_tests = +diff --git a/test/internals/syslog.c b/test/internals/syslog.c +new file mode 100644 +index 0000000..4f6b7c2 +--- /dev/null ++++ b/test/internals/syslog.c +@@ -0,0 +1,100 @@ ++/* Manual regression test for syslog support ++ * ++ * Author: Simon McVittie <simon.mcvit...@collabora.co.uk> ++ * Copyright © 2011 Nokia Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation files ++ * (the "Software"), to deal in the Software without restriction, ++ * including without limitation the rights to use, copy, modify, merge, ++ * publish, distribute, sublicense, and/or sell copies of the Software, ++ * and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS ++ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ */ ++ ++#include <config.h> ++ ++#include <stdlib.h> ++ ++#include <glib.h> ++ ++#define DBUS_COMPILATION /* this test uses libdbus-internal */ ++#include <dbus/dbus.h> ++#include <dbus/dbus-sysdeps.h> ++ ++typedef struct { ++ int dummy; ++} Fixture; ++ ++static void ++setup (Fixture *f, ++ gconstpointer data) ++{ ++} ++ ++/* hopefully clear enough that people don't think these messages in syslog ++ * are a bug */ ++#define MESSAGE "regression test for _dbus_system_log(): " ++ ++static void ++test_syslog (Fixture *f, ++ gconstpointer data) ++{ ++ if (g_test_trap_fork (0, 0)) ++ { ++ _dbus_init_system_log (); ++ _dbus_system_log (DBUS_SYSTEM_LOG_FATAL, MESSAGE "%d", 23); ++ /* should not be reached: exit 0 so the assertion in the main process ++ * will fail */ ++ exit (0); ++ } ++ ++ g_test_trap_assert_failed (); ++ g_test_trap_assert_stderr ("*" MESSAGE "23\n*"); ++ ++ if (g_test_trap_fork (0, 0)) ++ { ++ _dbus_init_system_log (); ++ _dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42); ++ _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666); ++ exit (0); ++ } ++ ++ g_test_trap_assert_passed (); ++ g_test_trap_assert_stderr ("*" MESSAGE "42\n*" MESSAGE "666\n*"); ++ ++ /* manual test (this is the best we can do on Windows) */ ++ _dbus_init_system_log (); ++ _dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42); ++ _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666); ++} ++ ++static void ++teardown (Fixture *f, ++ gconstpointer data) ++{ ++} ++ ++int ++main (int argc, ++ char **argv) ++{ ++ g_test_init (&argc, &argv, NULL); ++ g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); ++ ++ g_test_add ("/syslog", Fixture, NULL, setup, test_syslog, teardown); ++ ++ return g_test_run (); ++} +-- +1.7.5.4 + Modified: csw/mgar/pkg/dbus/trunk/files/dbus-sysdeps-unix.c.diff =================================================================== --- csw/mgar/pkg/dbus/trunk/files/dbus-sysdeps-unix.c.diff 2011-08-23 14:55:43 UTC (rev 15413) +++ csw/mgar/pkg/dbus/trunk/files/dbus-sysdeps-unix.c.diff 2011-08-23 15:35:33 UTC (rev 15414) @@ -5,8 +5,8 @@ #include <netdb.h> #include <grp.h> +#include <alloca.h> -+#define CMSG_SPACE(l) ((size_t)_CMSG_HDR_ALIGN(sizeof (struct cmsghdr) + (l))) -+#define CMSG_LEN(l) ((size_t)_CMSG_DATA_ALIGN(sizeof (struct cmsghdr)) + (l)) ++#define XXXCMSG_SPACE(l) ((size_t)_CMSG_HDR_ALIGN(sizeof (struct cmsghdr) + (l))) ++#define XXXCMSG_LEN(l) ((size_t)_CMSG_DATA_ALIGN(sizeof (struct cmsghdr)) + (l)) #ifdef HAVE_ERRNO_H #include <errno.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ devel mailing list devel@lists.opencsw.org https://lists.opencsw.org/mailman/listinfo/devel