[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#683977: unblock: gnome-games/3.4.2-3



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package gnome-games
It provides a fix for #675003, which has been prepared and applied upstream,
and I confirm it works as expected.

unblock gnome-games/3.4.2-3

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/8 CPU cores)
diff -ruN gnome-games/debian/changelog gnome-games-3.4.2/debian/changelog
--- gnome-games/debian/changelog	2012-08-05 23:35:37.890618139 +0200
+++ gnome-games-3.4.2/debian/changelog	2012-08-05 23:16:13.000000000 +0200
@@ -1,3 +1,12 @@
+gnome-games (1:3.4.2-3) unstable; urgency=medium
+
+  * Team upload.
+  * debian/patches/91_glchess_engine.patch:
+    - Cherry-pick patch from upstream Git to kill gnuchess engine
+      processes on new game/exit (Closes: #675003).
+
+ -- Luca Falavigna <dktrkranz@debian.org>  Sun, 05 Aug 2012 23:14:54 +0200
+
 gnome-games (1:3.4.2-2) unstable; urgency=low
 
   * debian/patches/02_swell-foop-datadir.patch: Install data files into
diff -ruN gnome-games/debian/control gnome-games-3.4.2/debian/control
--- gnome-games/debian/control	2012-08-05 23:35:37.890618139 +0200
+++ gnome-games-3.4.2/debian/control	2012-08-05 23:20:22.000000000 +0200
@@ -7,7 +7,7 @@
 Section: gnome
 Priority: optional
 Maintainer: Josselin Mouette <joss@debian.org>
-Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Emilio Pozuelo Monfort <pochu@debian.org>, Jordi Mallach <jordi@debian.org>, Michael Biebl <biebl@debian.org>
+Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Jordi Mallach <jordi@debian.org>, Michael Biebl <biebl@debian.org>
 Build-Depends: cdbs (>= 0.4.90~),
                debhelper (>= 8),
                dh-autoreconf,
diff -ruN gnome-games/debian/patches/91_glchess_engine.patch gnome-games-3.4.2/debian/patches/91_glchess_engine.patch
--- gnome-games/debian/patches/91_glchess_engine.patch	1970-01-01 01:00:00.000000000 +0100
+++ gnome-games-3.4.2/debian/patches/91_glchess_engine.patch	2012-08-05 23:14:39.000000000 +0200
@@ -0,0 +1,110 @@
+From 1eb18e95bad9135b516fbf6f77f516fa1ab8b402 Mon Sep 17 00:00:00 2001
+From: Robert Ancell <robert.ancell@canonical.com>
+Date: Sat, 14 Jul 2012 05:13:12 +0000
+Subject: glchess: Kill engine processes on new game/exit
+
+Index: gnome-games-3.4.2/glchess/src/chess-engine.vala
+===================================================================
+--- gnome-games-3.4.2.orig/glchess/src/chess-engine.vala	2012-05-15 06:37:48.000000000 +0200
++++ gnome-games-3.4.2/glchess/src/chess-engine.vala	2012-08-05 23:13:21.586577206 +0200
+@@ -35,9 +35,9 @@
+         try
+         {
+             Process.spawn_async_with_pipes (null, argv, null,
+-                                                 SpawnFlags.SEARCH_PATH,
+-                                                 null,
+-                                                 out pid, out stdin_fd, out stdout_fd, out stderr_fd);
++                                            SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD,
++                                            null,
++                                            out pid, out stdin_fd, out stdout_fd, out stderr_fd);
+         }
+         catch (SpawnError e)
+         {
+@@ -45,6 +45,8 @@
+             return false;
+         }
+ 
++        ChildWatch.add (pid, engine_stopped_cb);
++
+         stdout_channel = new IOChannel.unix_new (stdout_fd);
+         try
+         {
+@@ -60,7 +62,12 @@
+ 
+         return true;
+     }
+-    
++
++    private void engine_stopped_cb (Pid pid, int status)
++    {
++        stopped ();
++    }
++
+     public virtual void start_game ()
+     {
+     }
+@@ -79,8 +86,8 @@
+ 
+     public void stop ()
+     {
+-        // FIXME
+-        stopped ();
++        if (pid != 0)
++            Posix.kill (pid, Posix.SIGTERM);        
+     }
+ 
+     private bool read_cb (IOChannel source, IOCondition condition)
+Index: gnome-games-3.4.2/glchess/src/glchess.vala
+===================================================================
+--- gnome-games-3.4.2.orig/glchess/src/glchess.vala	2012-05-15 06:37:48.000000000 +0200
++++ gnome-games-3.4.2/glchess/src/glchess.vala	2012-08-05 23:13:21.586577206 +0200
+@@ -124,6 +124,13 @@
+         settings_changed_cb (settings, "show-3d");
+     }
+ 
++    protected override void shutdown ()
++    {
++        base.shutdown ();
++        if (opponent_engine != null)
++            opponent_engine.stop ();
++    }
++
+     public void quit_game ()
+     {
+         if (save_duration_timeout != 0)
+@@ -298,7 +305,14 @@
+             black_level = "normal";
+ 
+         opponent = null;
+-        opponent_engine = null;
++        if (opponent_engine != null)
++        {
++            opponent_engine.stop ();
++            opponent_engine.ready_changed.disconnect (engine_ready_cb);
++            opponent_engine.moved.disconnect (engine_move_cb);
++            opponent_engine.stopped.disconnect (engine_stopped_cb);
++            opponent_engine = null;
++        }
+         if (white_engine != null)
+         {
+             opponent = game.white;
+@@ -316,6 +330,7 @@
+         {
+             opponent_engine.ready_changed.connect (engine_ready_cb);
+             opponent_engine.moved.connect (engine_move_cb);
++            opponent_engine.stopped.connect (engine_stopped_cb);
+             opponent_engine.start ();
+         }
+ 
+@@ -436,6 +451,11 @@
+         opponent.move (move);
+     }
+ 
++    private void engine_stopped_cb (ChessEngine engine)
++    {
++        opponent.resign ();
++    }
++
+     private void game_start_cb (ChessGame game)
+     {
+         if (opponent_engine != null)
diff -ruN gnome-games/debian/patches/series gnome-games-3.4.2/debian/patches/series
--- gnome-games/debian/patches/series	2012-08-05 23:08:14.966567810 +0200
+++ gnome-games-3.4.2/debian/patches/series	2012-08-05 23:12:56.000000000 +0200
@@ -1,3 +1,4 @@
 01_swell-foop-setgid.patch
 02_swell-foop-datadir.patch
 91_fix-gnuchess6-compatibility.patch
+91_glchess_engine.patch

Reply to: