rpms/gnome-games/devel sudoku-saved-data.patch, NONE, 1.1 gnome-games.spec, 1.202, 1.203

Matthias Clasen mclasen at fedoraproject.org
Thu Apr 2 02:04:19 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gnome-games/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20238

Modified Files:
	gnome-games.spec 
Added Files:
	sudoku-saved-data.patch 
Log Message:
Fix a sudoku crash


sudoku-saved-data.patch:

--- NEW FILE sudoku-saved-data.patch ---
--- trunk/gnome-sudoku/src/lib/saver.py	2009/03/28 00:47:14	8910
+++ trunk/gnome-sudoku/src/lib/saver.py	2009/03/28 02:05:39	8911
@@ -211,8 +211,22 @@
             except:
                 print 'Warning: could not read file',f
             else:
-                jar['saved_at']=os.stat(f)[8]
-                games.append(jar)
+                if self.is_valid(jar):
+                    jar['saved_at']=os.stat(f)[8]
+                    games.append(jar)
+                else:
+                    print 'Warning: malformed save game',f
         return games
-        
+
+    def is_valid (self, jar):
+        virgin = jar['game'].split('\n')[0].replace(' ','')
+        played = jar['game'].split('\n')[1].replace(' ','')
+
+        if len(virgin) != 81 or len(played) != 81:
+            return False
+
+        if not virgin.isdigit() or not played.isdigit():
+            return False
+
+        return True
 



Index: gnome-games.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-games/devel/gnome-games.spec,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -r1.202 -r1.203
--- gnome-games.spec	17 Mar 2009 01:02:48 -0000	1.202
+++ gnome-games.spec	2 Apr 2009 02:03:49 -0000	1.203
@@ -44,7 +44,7 @@
 Summary: Games for the GNOME desktop
 Name: gnome-games
 Version: 2.26.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 Epoch: 1
 License: GPLv2+ and GFDL
 Group: Amusements/Games
@@ -52,6 +52,8 @@
 # http://bugzilla.gnome.org/show_bug.cgi?id=551455
 Patch0: ggz-api-changes.patch
 Patch1: gnome-games-2.19.4-gnometris-rebrand.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=516491
+Patch2: sudoku-saved-data.patch
 
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes: gnome-games-devel
@@ -124,6 +126,7 @@
 %patch0 -p1 -b .ggz-api-changes
 # rebrand gnometris as some think the name is to similar to a trademark
 %patch1 -p1 -b .rebrand
+%patch2 -p1 -b .sudoku-saved-data
 
 sed -i -e 's/Gnometris/GnomeFallingBlocks/g' \
   -e 's/GNOMEtris/GnomeFallingBlocks/g' \
@@ -355,6 +358,9 @@
 %{_datadir}/omf/*
 
 %changelog
+* Wed Apr  1 2009 Matthias Clasen <mclasen at redhat.com> - 1:2.26.0-2
+- Add a workaround for sudoku crashing on certain saved games (#492962)
+
 * Mon Mar 16 2009 Matthias Clasen <mclasen at redhat.com> - 1:2.26.0-1
 - Update to 2.26.0
 




More information about the fedora-extras-commits mailing list