Gentoo Archives: gentoo-commits

From: "Alexandre Rostovtsev (tetromino)" <tetromino@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/glib/files: glib-2.30.2-machine-id.patch
Date: Mon, 14 Nov 2011 08:11:41
Message-Id: 20111114081112.8E5A32004C@flycatcher.gentoo.org
tetromino    11/11/14 08:11:12

  Added:                glib-2.30.2-machine-id.patch
  Log:
  Bump. Notable changes: gdbus-related bugfixes. Add patch to detect machine-id in both /etc and /var, and lower dbus dep. Compile tests when USE=doc to prevent build failure (bug #387385, solution proposed by Pacho Ramos).
  
  (Portage version: 2.2.0_alpha74/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-libs/glib/files/glib-2.30.2-machine-id.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/glib/files/glib-2.30.2-machine-id.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/glib/files/glib-2.30.2-machine-id.patch?rev=1.1&content-type=text/plain

Index: glib-2.30.2-machine-id.patch
===================================================================
From 1c9eceaccb6e6c4339cd6951cf53fbd60ae80b8b Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@g.o>
Date: Mon, 14 Nov 2011 01:43:22 -0500
Subject: [PATCH] _g_dbus_get_machine_id(): check /etc/machine-id too

machine-id can be in /etc or in /var/lib/dbus.

https://bugzilla.gnome.org/show_bug.cgi?id=663928
---
 gio/gdbusprivate.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index 55ac883..68c3ddf 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -1985,7 +1985,11 @@ _g_dbus_get_machine_id (GError **error)
   gchar *ret;
   /* TODO: use PACKAGE_LOCALSTATEDIR ? */
   ret = NULL;
-  if (!g_file_get_contents ("/var/lib/dbus/machine-id",
+  if (!g_file_get_contents ("/etc/machine-id",
+                            &ret,
+                            NULL,
+                            NULL) &&
+      !g_file_get_contents ("/var/lib/dbus/machine-id",
                             &ret,
                             NULL,
                             error))
-- 
1.7.8.rc1