Apply multiple fixes for tests, also a one to prevent hangs by Markos Chandras (bug...
authorPacho Ramos <pacho@gentoo.org>
Mon, 12 Sep 2011 08:41:50 +0000 (08:41 +0000)
committerPacho Ramos <pacho@gentoo.org>
Mon, 12 Sep 2011 08:41:50 +0000 (08:41 +0000)
Package-Manager: portage-2.1.10.14/cvs/Linux x86_64

gnome-base/libgnome-keyring/ChangeLog
gnome-base/libgnome-keyring/Manifest
gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-drop-test.patch [new file with mode: 0644]
gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-hang-tests.patch [new file with mode: 0644]
gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-run-test.patch [new file with mode: 0644]
gnome-base/libgnome-keyring/libgnome-keyring-2.32.0.ebuild

index bb60ade9f6d192814c2d1e7383771c70c075b224..b505e97aa95e2dae61ca85daa43ae60ee4862bd0 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for gnome-base/libgnome-keyring
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-base/libgnome-keyring/ChangeLog,v 1.27 2011/08/17 16:47:43 chithanh Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/libgnome-keyring/ChangeLog,v 1.28 2011/09/12 08:41:50 pacho Exp $
+
+  12 Sep 2011; Pacho Ramos <pacho@gentoo.org> libgnome-keyring-2.32.0.ebuild,
+  +files/libgnome-keyring-2.32.0-drop-test.patch,
+  +files/libgnome-keyring-2.32.0-hang-tests.patch,
+  +files/libgnome-keyring-2.32.0-run-test.patch:
+  Apply multiple fixes for tests, also a one to prevent hangs by Markos
+  Chandras (bug #356141).
 
   17 Aug 2011; Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
   libgnome-keyring-2.32.0.ebuild, libgnome-keyring-3.0.3-r1.ebuild:
index f22a0f4756ed81ee3605af48f564dd9d6a0e4227..80a3efd5ae5b2da06d9367c429d92b90de7a2bc7 100644 (file)
@@ -1,6 +1,19 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX libgnome-keyring-2.32.0-drop-test.patch 3415 RMD160 dfe6b9b0b017cddf1eb4ee216c0bf7d40836ea37 SHA1 3859d1c49dc1c1816cb80e068e220021a1bc764b SHA256 4928c561f46b6dabab93d19a82ff3cb6afa76a62bbba19312c417372b28eba89
+AUX libgnome-keyring-2.32.0-hang-tests.patch 607 RMD160 13926efd8ba29ead2648bd345cf3453a1353f4a7 SHA1 1f7117a9ebf87a337d6956d923f318e0011d1242 SHA256 d48a03c9c241c2e23e6abc32627ee0c454aad50ab0287793895b5af784dc11c0
+AUX libgnome-keyring-2.32.0-run-test.patch 2090 RMD160 58b7eb297dd901a0bb4d1abd54091f36ce82847a SHA1 c93f326daf89f0a91c86ad05b638375e77a7f15f SHA256 cdcbd565a4508b3f7211e69617b66442248414c1486cba70d59bc0bf93b21740
 DIST libgnome-keyring-2.32.0.tar.bz2 412592 RMD160 201df6c60a931a43edd58c994dea5bb20d5d378f SHA1 9d7c9dc923e03ed2f201cb563e28922e35b88ea0 SHA256 56388c0d81ddfdb57d30e4963c83ecc1c18498aab99395420e0fff69929a0f0c
 DIST libgnome-keyring-3.0.3.tar.bz2 423918 RMD160 c3c5ced166e1402e1a7a27b9bf7aa97f80406c34 SHA1 2191dcf06f3fa5412853106f20a95c33a499235e SHA256 a0cc08bcd431070d3f01c2741903c2bd8b0231ee73de709d28e722e28575fdf8
-EBUILD libgnome-keyring-2.32.0.ebuild 1296 RMD160 d8000e0595c27c10ac51979d7ecaaf0f74854397 SHA1 81bc0acced186303e2d2254d2ff7c92c8766baa2 SHA256 94be807154a34095f1a04a82dc5a94a5dd1d984e634fd53c454bf21afa16302d
+EBUILD libgnome-keyring-2.32.0.ebuild 1683 RMD160 63d9be3a642def5984ab38066f3942483bed3405 SHA1 42a23296dec1f65fa5ee14d569113b52a5347973 SHA256 3d7c79b8518182bd59ba575afbb9d0ba1ea979309cb867b4f4ee9e434939ab84
 EBUILD libgnome-keyring-3.0.3-r1.ebuild 1378 RMD160 c63be871a4c91186de9c49c15855593d9d9f694a SHA1 1c56570eeb9763a40689bf2b7dcc1d2490476be7 SHA256 27f6fc4dc2c4d16e820a3c47edea418906316acd4ef9df27ed77299e1fe60d19
-MISC ChangeLog 4125 RMD160 b3e84c9c66874ff8f1bbafb1e5e58d1007d40223 SHA1 1c26c01914a42dea5216b2124c31da929ad70664 SHA256 82bdb14e6ffd4888e7eb3752673947636d1d340950a07e80d323619560baba21
+MISC ChangeLog 4449 RMD160 f917dda4b44d79363eb03d38f6ce41d6b2f22ab0 SHA1 5a253f71af3547bd35a46568a7f6ab2640fb9a92 SHA256 ae560979a17a09635500248c31bba2119e50a9acea0f8b450cfa52f160ec82d1
 MISC metadata.xml 158 RMD160 c0e2bae8e91bb6be8922bac5e4f597302e06587e SHA1 38f78e9790bcd4382b4a49aa226aa6dda1d3a3d7 SHA256 3a7dbca0fdc557de69783e0663e2d76ddab129ea8a19b2d0ef6d3e5d1b947ce1
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.17 (GNU/Linux)
+
+iEYEARECAAYFAk5txdQACgkQCaWpQKGI+9QUcwCfZxU0V2LjkELPTobntVHmRZjt
+AMMAnjfngu2EvKtPPyuyXTW3DQFhM9ji
+=8N2E
+-----END PGP SIGNATURE-----
diff --git a/gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-drop-test.patch b/gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-drop-test.patch
new file mode 100644 (file)
index 0000000..9cbd156
--- /dev/null
@@ -0,0 +1,122 @@
+From 987f84c13bac6032164616b220289b5824bbd6a2 Mon Sep 17 00:00:00 2001
+From: Stef Walter <stef@memberwebs.com>
+Date: Wed, 19 Jan 2011 19:44:39 +0000
+Subject: Remove unneeded test file.
+
+---
+diff --git a/library/tests/Makefile.am b/library/tests/Makefile.am
+index 9514c47..0a54cc7 100644
+--- a/library/tests/Makefile.am
++++ b/library/tests/Makefile.am
+@@ -2,16 +2,12 @@
+ TEST_AUTO = \
+       test-memory.c \
+       test-keyrings.c \
+-      test-other.c \
+-      test-daemon-setup.c
++      test-other.c
+ TEST_LIBS = \
+       $(top_builddir)/egg/libegg.la \
+       $(top_builddir)/library/libgnome-keyring.la
+-TEST_FLAGS = \
+-      -DTEST_WITH_DAEMON
+-
+ include $(top_srcdir)/tests/gtest.make
+ # ------------------------------------------------------------------
+diff --git a/library/tests/test-daemon-setup.c b/library/tests/test-daemon-setup.c
+deleted file mode 100644
+index 077656d..0000000
+--- a/library/tests/test-daemon-setup.c
++++ b/dev/null
+@@ -1,86 +0,0 @@
+-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+-/* unit-test-daemon-setup.c: Start a gnome-keyring-daemon process for testing
+-
+-   Copyright (C) 2007 Stefan Walter
+-
+-   The Gnome Keyring Library is free software; you can redistribute it and/or
+-   modify it under the terms of the GNU Library General Public License as
+-   published by the Free Software Foundation; either version 2 of the
+-   License, or (at your option) any later version.
+-
+-   The Gnome Keyring Library is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-   Library General Public License for more details.
+-
+-   You should have received a copy of the GNU Library General Public
+-   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+-   Boston, MA 02111-1307, USA.
+-
+-   Author: Stef Walter <stef@memberwebs.com>
+-*/
+-
+-#include <stdlib.h>
+-#include <stdio.h>
+-#include <string.h>
+-#include <signal.h>
+-#include <unistd.h>
+-
+-#include "run-auto-test.h"
+-
+-#include "library/gnome-keyring.h"
+-
+-#if 0
+-static GPid daemon_pid;
+-#endif
+-
+-DEFINE_START(setup_daemon)
+-{
+-#if 0
+-      GError *err = NULL;
+-      gchar *args[3];
+-      const gchar *outside, *path;
+-      gboolean start = FALSE;
+-      gchar *socket;
+-
+-      /* If already setup somewhere else, then don't start daemon here */
+-      outside = g_getenv ("GNOME_KEYRING_OUTSIDE_TEST");
+-      if (!outside || !outside[0])
+-              start = TRUE;
+-
+-      path = g_getenv ("GNOME_KEYRING_TEST_PATH");
+-      g_assert (path && path[0]);
+-
+-      socket = g_strdup_printf ("%s/socket", path);
+-      g_setenv ("GNOME_KEYRING_SOCKET", socket, TRUE);
+-
+-      if (!start)
+-              return;
+-
+-      g_printerr ("Starting gnome-keyring-daemon...\n");
+-
+-      args[0] = "../../daemon/gnome-keyring-daemon";
+-      args[1] = "-f";
+-      args[2] = NULL;
+-
+-      if (!g_spawn_async (NULL, args, NULL, G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_DO_NOT_REAP_CHILD,
+-                          NULL, NULL, &daemon_pid, &err)) {
+-              g_error ("couldn't start gnome-keyring-daemon for testing: %s",
+-                       err && err->message ? err->message : "");
+-              g_assert_not_reached ();
+-      }
+-
+-      /* Let it startup properly */
+-      sleep (2);
+-#endif
+-}
+-
+-DEFINE_STOP(setup_daemon)
+-{
+-#if 0
+-      if (daemon_pid)
+-              kill (daemon_pid, SIGTERM);
+-      /* We're exiting soon anyway, no need to wait */
+-#endif
+-}
+--
+cgit v0.9.0.2
diff --git a/gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-hang-tests.patch b/gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-hang-tests.patch
new file mode 100644 (file)
index 0000000..4058389
--- /dev/null
@@ -0,0 +1,21 @@
+Index: libgnome-keyring-2.32.0/egg/tests/test-dh.c
+===================================================================
+--- libgnome-keyring-2.32.0.orig/egg/tests/test-dh.c
++++ libgnome-keyring-2.32.0/egg/tests/test-dh.c
+@@ -27,6 +27,7 @@
+ #include "run-auto-test.h"
++#include "egg-libgcrypt.h"
+ #include "egg-dh.h"
+ #include "egg-secure-memory.h"
+@@ -39,7 +40,7 @@ DEFINE_TEST(dh_perform)
+       gcry_mpi_t x2, X2;
+       gpointer k1, k2;
+       gboolean ret;
+-
++      egg_libgcrypt_initialize ();
+       /* Load up the parameters */
+       if (!egg_dh_default_params ("ietf-ike-grp-modp-768", &p, &g))
+               g_assert_not_reached ();
diff --git a/gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-run-test.patch b/gnome-base/libgnome-keyring/files/libgnome-keyring-2.32.0-run-test.patch
new file mode 100644 (file)
index 0000000..efc47df
--- /dev/null
@@ -0,0 +1,87 @@
+From ffbaa40603ed33646de10822983c9445d6c70d3a Mon Sep 17 00:00:00 2001
+From: Stef Walter <stef@memberwebs.com>
+Date: Wed, 19 Jan 2011 19:44:50 +0000
+Subject: Don't run tests if a testing enabled gnome-keyring-daemon is not enabled.
+
+This uses the 'gnome-keyring-daemon --version' output to determine
+whether testing is enabled or not.
+---
+diff --git a/tests/gtest-helpers.c b/tests/gtest-helpers.c
+index fbdb5d7..e984f64 100644
+--- a/tests/gtest-helpers.c
++++ b/tests/gtest-helpers.c
+@@ -160,16 +160,17 @@ chdir_base_dir (char* argv0)
+       g_free (dir);
+ }
+-#ifdef TEST_WITH_DAEMON
+-
+ static pid_t daemon_pid = 0;
+ static gboolean
+-daemon_start ()
++daemon_start (void)
+ {
+       GError *err = NULL;
+       gchar *args[5];
+       const gchar *path, *service, *address;
++      gchar *output = NULL;
++      gint exit_status = 1;
++      GError *error = NULL;
+       /* Need to have DBUS running */
+       address = g_getenv ("DBUS_SESSION_BUS_ADDRESS");
+@@ -178,6 +179,23 @@ daemon_start ()
+               return FALSE;
+       }
++      /* Check if gnome-keyring-daemon has testing enabled */
++      if (!g_spawn_command_line_sync (GNOME_KEYRING_DAEMON_PATH " --version",
++                                      &output, NULL, &exit_status, &error)) {
++              g_printerr ("Couldn't launch '%s': %s", GNOME_KEYRING_DAEMON_PATH,
++                          error->message);
++              return FALSE;
++      }
++
++      /* For some reason --version failed */
++      if (exit_status != 0 || strstr (output, "testing: enabled") == NULL) {
++              g_printerr ("Skipping tests since no testing enabled gnome-keyring-daemin is available\n");
++              g_free (output);
++              return FALSE;
++      }
++
++      g_free (output);
++
+       path = g_getenv ("GNOME_KEYRING_TEST_PATH");
+       if (path && !path[0])
+               path = NULL;
+@@ -221,8 +239,6 @@ daemon_stop (void)
+       daemon_pid = 0;
+ }
+-#endif /* TEST_WITH_DAEMON */
+-
+ int
+ main (int argc, char* argv[])
+ {
+@@ -239,18 +255,12 @@ main (int argc, char* argv[])
+       initialize_tests ();
+-#ifdef TEST_WITH_DAEMON
+       if (daemon_start ()) {
+-#endif
+-
+               start_tests ();
+               ret = g_test_run ();
+               stop_tests();
+-
+-#ifdef TEST_WITH_DAEMON
+               daemon_stop();
+       }
+-#endif
+       return ret;
+ }
+--
+cgit v0.9.0.2
index a7fd15bc52dad328b23b181019af03a3df6f9de5..1aab4f2edbf69dbcbc21d7a814782cd88f5b5782 100644 (file)
@@ -1,11 +1,12 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-base/libgnome-keyring/libgnome-keyring-2.32.0.ebuild,v 1.12 2011/08/17 16:47:43 chithanh Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/libgnome-keyring/libgnome-keyring-2.32.0.ebuild,v 1.13 2011/09/12 08:41:50 pacho Exp $
 
-EAPI="3"
+EAPI="4"
 GCONF_DEBUG="yes"
+GNOME_TARBALL_SUFFIX="bz2"
 
-inherit gnome2
+inherit gnome2 eutils autotools
 
 DESCRIPTION="Compatibility library for accessing secrets"
 HOMEPAGE="http://live.gnome.org/GnomeKeyring"
@@ -35,6 +36,15 @@ pkg_setup() {
 src_prepare() {
        gnome2_src_prepare
 
+       # Remove unneeded test file.
+       epatch "${FILESDIR}/${P}-drop-test.patch"
+
+       # Don't run tests if a testing enabled gnome-keyring-daemon is not enabled.
+       epatch "${FILESDIR}/${P}-run-test.patch"
+
+       # Don't let tests to hang, bug #356141
+       epatch "${FILESDIR}/${PN}-2.32.0-hang-tests.patch"
+
        # Remove silly CFLAGS
        sed 's:CFLAGS="$CFLAGS -Werror:CFLAGS="$CFLAGS:' \
                -i configure.in configure || die "sed failed"
@@ -42,9 +52,12 @@ src_prepare() {
        # Remove DISABLE_DEPRECATED flags
        sed -e '/-D[A-Z_]*DISABLE_DEPRECATED/d' \
                -i configure.in configure || die "sed 2 failed"
+
+       intltoolize --force --copy --automake || die "intltoolize failed"
+       eautoreconf
 }
 
 src_test() {
        unset DBUS_SESSION_BUS_ADDRESS
-       emake check || die "tests failed"
+       emake check
 }