rpms/dbus-glib/devel dbus-glib-0.74-freeze-abi.patch, NONE, 1.1 dbus-glib.spec, 1.25, 1.26

Colin Walters (walters) fedora-extras-commits at redhat.com
Tue Apr 15 16:31:58 UTC 2008


Author: walters

Update of /cvs/pkgs/rpms/dbus-glib/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7261

Modified Files:
	dbus-glib.spec 
Added Files:
	dbus-glib-0.74-freeze-abi.patch 
Log Message:
add patch to ensure frozen ABI

dbus-glib-0.74-freeze-abi.patch:

--- NEW FILE dbus-glib-0.74-freeze-abi.patch ---
>From 8fe656de630e851bc512bbd7e7a6c18c53aecb61 Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Mon, 14 Apr 2008 12:56:43 +0100
Subject: [PATCH] Freeze error ABI at the ABI used in Fedora 8 and Ubuntu gutsy.

This avoids getting a different ABI depending on the version of libdbus
we're compiled against. fd.o #15430, Debian #476080.
---
 dbus/dbus-glib.h                    |   34 ++++++++++++++++-
 dbus/dbus-gobject.c                 |   72 ++++++++++++++++++++++++++++++++++-
 dbus/make-dbus-glib-error-enum.sh   |   25 +------------
 dbus/make-dbus-glib-error-switch.sh |   29 +-------------
 4 files changed, 106 insertions(+), 54 deletions(-)

diff --git a/dbus/dbus-glib.h b/dbus/dbus-glib.h
index b1084ba..c4049f3 100644
--- a/dbus/dbus-glib.h
+++ b/dbus/dbus-glib.h
@@ -60,7 +60,39 @@ GQuark dbus_g_error_quark (void);
 
 typedef enum
 {
-#include "dbus-glib-error-enum.h" 
+DBUS_GERROR_FAILED,
+DBUS_GERROR_NO_MEMORY,
+DBUS_GERROR_SERVICE_UNKNOWN,
+DBUS_GERROR_NAME_HAS_NO_OWNER,
+DBUS_GERROR_NO_REPLY,
+DBUS_GERROR_IO_ERROR,
+DBUS_GERROR_BAD_ADDRESS,
+DBUS_GERROR_NOT_SUPPORTED,
+DBUS_GERROR_LIMITS_EXCEEDED,
+DBUS_GERROR_ACCESS_DENIED,
+DBUS_GERROR_AUTH_FAILED,
+DBUS_GERROR_NO_SERVER,
+DBUS_GERROR_TIMEOUT,
+DBUS_GERROR_NO_NETWORK,
+DBUS_GERROR_ADDRESS_IN_USE,
+DBUS_GERROR_DISCONNECTED,
+DBUS_GERROR_INVALID_ARGS,
+DBUS_GERROR_FILE_NOT_FOUND,
+DBUS_GERROR_FILE_EXISTS,
+DBUS_GERROR_UNKNOWN_METHOD,
+DBUS_GERROR_TIMED_OUT,
+DBUS_GERROR_MATCH_RULE_NOT_FOUND,
+DBUS_GERROR_MATCH_RULE_INVALID,
+DBUS_GERROR_SPAWN_EXEC_FAILED,
+DBUS_GERROR_SPAWN_FORK_FAILED,
+DBUS_GERROR_SPAWN_CHILD_EXITED,
+DBUS_GERROR_SPAWN_CHILD_SIGNALED,
+DBUS_GERROR_SPAWN_FAILED,
+DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN,
+DBUS_GERROR_INVALID_SIGNATURE,
+DBUS_GERROR_INVALID_FILE_CONTENT,
+DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN,
+DBUS_GERROR_REMOTE_EXCEPTION
 } DBusGError;
 
 gboolean         dbus_g_error_has_name    (GError      *error,
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c
index dae2dac..6596309 100644
--- a/dbus/dbus-gobject.c
+++ b/dbus/dbus-gobject.c
@@ -1668,7 +1668,77 @@ export_signals (DBusGConnection *connection, const GList *info_list, GObject *ob
     }
 }
 
-#include "dbus-glib-error-switch.h"
+static gint
+dbus_error_to_gerror_code (const char *derr)
+{
+  if (0) ; 
+  else if (!strcmp (derr,  DBUS_ERROR_FAILED  )) 
+    return  DBUS_GERROR_FAILED ;
+  else if (!strcmp (derr,  DBUS_ERROR_NO_MEMORY  )) 
+    return  DBUS_GERROR_NO_MEMORY ;
+  else if (!strcmp (derr,  DBUS_ERROR_SERVICE_UNKNOWN  )) 
+    return  DBUS_GERROR_SERVICE_UNKNOWN ;
+  else if (!strcmp (derr,  DBUS_ERROR_NAME_HAS_NO_OWNER  )) 
+    return  DBUS_GERROR_NAME_HAS_NO_OWNER ;
+  else if (!strcmp (derr,  DBUS_ERROR_NO_REPLY  )) 
+    return  DBUS_GERROR_NO_REPLY ;
+  else if (!strcmp (derr,  DBUS_ERROR_IO_ERROR  )) 
+    return  DBUS_GERROR_IO_ERROR ;
+  else if (!strcmp (derr,  DBUS_ERROR_BAD_ADDRESS  )) 
+    return  DBUS_GERROR_BAD_ADDRESS ;
+  else if (!strcmp (derr,  DBUS_ERROR_NOT_SUPPORTED  )) 
+    return  DBUS_GERROR_NOT_SUPPORTED ;
+  else if (!strcmp (derr,  DBUS_ERROR_LIMITS_EXCEEDED  )) 
+    return  DBUS_GERROR_LIMITS_EXCEEDED ;
+  else if (!strcmp (derr,  DBUS_ERROR_ACCESS_DENIED  )) 
+    return  DBUS_GERROR_ACCESS_DENIED ;
+  else if (!strcmp (derr,  DBUS_ERROR_AUTH_FAILED  )) 
+    return  DBUS_GERROR_AUTH_FAILED ;
+  else if (!strcmp (derr,  DBUS_ERROR_NO_SERVER  )) 
+    return  DBUS_GERROR_NO_SERVER ;
+  else if (!strcmp (derr,  DBUS_ERROR_TIMEOUT  )) 
+    return  DBUS_GERROR_TIMEOUT ;
+  else if (!strcmp (derr,  DBUS_ERROR_NO_NETWORK  )) 
+    return  DBUS_GERROR_NO_NETWORK ;
+  else if (!strcmp (derr,  DBUS_ERROR_ADDRESS_IN_USE  )) 
+    return  DBUS_GERROR_ADDRESS_IN_USE ;
+  else if (!strcmp (derr,  DBUS_ERROR_DISCONNECTED  )) 
+    return  DBUS_GERROR_DISCONNECTED ;
+  else if (!strcmp (derr,  DBUS_ERROR_INVALID_ARGS  )) 
+    return  DBUS_GERROR_INVALID_ARGS ;
+  else if (!strcmp (derr,  DBUS_ERROR_FILE_NOT_FOUND  )) 
+    return  DBUS_GERROR_FILE_NOT_FOUND ;
+  else if (!strcmp (derr,  DBUS_ERROR_FILE_EXISTS  )) 
+    return  DBUS_GERROR_FILE_EXISTS ;
+  else if (!strcmp (derr,  DBUS_ERROR_UNKNOWN_METHOD  )) 
+    return  DBUS_GERROR_UNKNOWN_METHOD ;
+  else if (!strcmp (derr,  DBUS_ERROR_TIMED_OUT  )) 
+    return  DBUS_GERROR_TIMED_OUT ;
+  else if (!strcmp (derr,  DBUS_ERROR_MATCH_RULE_NOT_FOUND  )) 
+    return  DBUS_GERROR_MATCH_RULE_NOT_FOUND ;
+  else if (!strcmp (derr,  DBUS_ERROR_MATCH_RULE_INVALID  )) 
+    return  DBUS_GERROR_MATCH_RULE_INVALID ;
+  else if (!strcmp (derr,  DBUS_ERROR_SPAWN_EXEC_FAILED  )) 
+    return  DBUS_GERROR_SPAWN_EXEC_FAILED ;
+  else if (!strcmp (derr,  DBUS_ERROR_SPAWN_FORK_FAILED  )) 
+    return  DBUS_GERROR_SPAWN_FORK_FAILED ;
+  else if (!strcmp (derr,  DBUS_ERROR_SPAWN_CHILD_EXITED  )) 
+    return  DBUS_GERROR_SPAWN_CHILD_EXITED ;
+  else if (!strcmp (derr,  DBUS_ERROR_SPAWN_CHILD_SIGNALED  )) 
+    return  DBUS_GERROR_SPAWN_CHILD_SIGNALED ;
+  else if (!strcmp (derr,  DBUS_ERROR_SPAWN_FAILED  )) 
+    return  DBUS_GERROR_SPAWN_FAILED ;
+  else if (!strcmp (derr,  DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN  )) 
+    return  DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN ;
+  else if (!strcmp (derr,  DBUS_ERROR_INVALID_SIGNATURE  )) 
+    return  DBUS_GERROR_INVALID_SIGNATURE ;
+  else if (!strcmp (derr,  DBUS_ERROR_INVALID_FILE_CONTENT  )) 
+    return  DBUS_GERROR_INVALID_FILE_CONTENT ;
+  else if (!strcmp (derr,  DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN  )) 
+    return  DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN ;
+  else
+    return DBUS_GERROR_REMOTE_EXCEPTION;
+}
 
 /**
  * dbus_set_g_error:
diff --git a/dbus/make-dbus-glib-error-enum.sh b/dbus/make-dbus-glib-error-enum.sh
index 1646333..1d7929a 100755
--- a/dbus/make-dbus-glib-error-enum.sh
+++ b/dbus/make-dbus-glib-error-enum.sh
@@ -1,25 +1,2 @@
 #!/bin/sh
-
-SRC=$1
-DEST=$2
-
-die()
-{
-    echo $1 1>&2
-    /bin/rm $DEST.tmp
-    exit 1
-}
-
-cat $SRC | grep '#define DBUS_ERROR' | sed -e 's/#define //g' | \
-  sed -e 's/".*//g' | sed -e 's/DBUS_ERROR/DBUS_GERROR/g' | sed -e 's/ *$/,/g' > $DEST.tmp
-
-if test ! -s $DEST.tmp ; then
-    die "$DEST.tmp is empty, something went wrong, see any preceding error message"
-fi
-echo "DBUS_GERROR_REMOTE_EXCEPTION" >> $DEST.tmp
-
-echo "#ifndef DBUS_INSIDE_DBUS_GLIB_H" >> $DEST.tmp
-echo '#error "' "$DEST" 'may only be included by dbus-glib.h"' >> $DEST.tmp
-echo "#endif" >> $DEST.tmp
-
-mv $DEST.tmp $DEST || die "could not move $DEST.tmp to $DEST"
+echo "#error This header makes no sense - see bugs.freedesktop.org 15430" >$2
diff --git a/dbus/make-dbus-glib-error-switch.sh b/dbus/make-dbus-glib-error-switch.sh
index 602cf99..1d7929a 100755
--- a/dbus/make-dbus-glib-error-switch.sh
+++ b/dbus/make-dbus-glib-error-switch.sh
@@ -1,29 +1,2 @@
 #!/bin/sh
-
-SRC=$1
-DEST=$2
-
-die()
-{
-    echo $1 1>&2
-    /bin/rm $DEST.tmp
-    exit 1
-}
-
-echo 'static gint' > $DEST.tmp
-echo 'dbus_error_to_gerror_code (const char *derr)' >> $DEST.tmp
-echo '{' >> $DEST.tmp
-echo '  if (0) ; ' >> $DEST.tmp
-
-cat $SRC | grep '#define DBUS_ERROR' | sed -e 's/#define //g' | \
-  sed -e 's/".*//g' | \
-   (while read line; do \
-     echo '  else if (!strcmp (derr, ' "$line" ' )) '; \
-     echo '    return ' `echo $line | sed -e 's/DBUS_ERROR/DBUS_GERROR/g'` ';'; \
-    done; \
-   ) >> $DEST.tmp
-echo '  else' >> $DEST.tmp
-echo '    return DBUS_GERROR_REMOTE_EXCEPTION;' >> $DEST.tmp
-echo '}' >> $DEST.tmp
-
-mv $DEST.tmp $DEST || die "could not move $DEST.tmp to $DEST"
+echo "#error This header makes no sense - see bugs.freedesktop.org 15430" >$2
-- 
1.5.5



Index: dbus-glib.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dbus-glib/devel/dbus-glib.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- dbus-glib.spec	4 Apr 2008 19:44:27 -0000	1.25
+++ dbus-glib.spec	15 Apr 2008 16:31:16 -0000	1.26
@@ -8,7 +8,7 @@
 Summary: GLib bindings for D-Bus
 Name: dbus-glib
 Version: 0.74
-Release: 6%{?dist}
+Release: 7%{?dist}
 URL: http://www.freedesktop.org/software/dbus/
 Source0: http://dbus.freedesktop.org/releases/dbus-glib/%{name}-%{version}.tar.gz
 Source1: dbus-bus-introspect.xml
@@ -18,6 +18,8 @@
 Patch2: dbus-glib-0.73-ignore-namespaces-and-children.patch
 Patch3: dbus-glib-0.74-set-default-timeout-for-proxy.patch
 Patch4: dbus-glib-0.74-export-getall.patch
+# http://bugs.freedesktop.org/show_bug.cgi?id=15430
+Patch5: dbus-glib-0.74-freeze-abi.patch
 License: AFL/GPL
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -123,6 +125,9 @@
 %endif
 
 %changelog
+* Tue Apr 15 2008 Colin Walters <walters at redhat.com> - 0.74-7
+- Ensure ABI is frozen as it stands now
+
 * Fri Apr  4 2008 David Zeuthen <davidz at redhat.com> - 0.74-6
 - Add another upstreamed patch for setting the default timeout
   on a proxy




More information about the scm-commits mailing list