Bug#759312: wheezy-pu: package gnubg/0.90+20120429-1
"Adam D. Barratt" <adam@adam-barratt.org.uk> writes:
> The patch looks fine, thanks. Just for a final confirmation, please
> could we have a debdiff of the proposed upload (against the current
> stable package); please use 0.90+20120429-1+deb7u1 as the version.
The debdiff is attached. Sorry about the obnoxious patch of a patch; the
unstable version no longer uses single-debian-patch, but I was still using
it then. Regeneration of the diff of course changed the order of the
modified files, so the diff is particularly ugly.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
diff -Nru gnubg-0.90+20120429/debian/changelog gnubg-0.90+20120429/debian/changelog
--- gnubg-0.90+20120429/debian/changelog 2012-04-28 20:56:29.000000000 -0700
+++ gnubg-0.90+20120429/debian/changelog 2014-08-25 21:59:14.000000000 -0700
@@ -1,3 +1,10 @@
+gnubg (0.90+20120429-1+deb7u1) stable; urgency=low
+
+ * Apply upstream patch to prevent a crash on "end game" when gnubg is
+ run with the -t option. (Closes: #754764)
+
+ -- Russ Allbery <rra@debian.org> Mon, 25 Aug 2014 21:56:34 -0700
+
gnubg (0.90+20120429-1) unstable; urgency=low
* New upstream development snapshot.
diff -Nru gnubg-0.90+20120429/debian/patches/debian-changes gnubg-0.90+20120429/debian/patches/debian-changes
--- gnubg-0.90+20120429/debian/patches/debian-changes 2012-04-28 20:56:51.000000000 -0700
+++ gnubg-0.90+20120429/debian/patches/debian-changes 2014-08-25 21:59:59.000000000 -0700
@@ -7,6 +7,54 @@
For full commit history and separated commits, see the packaging Git
repository.
+--- gnubg-0.90+20120429.orig/eval.c
++++ gnubg-0.90+20120429/eval.c
+@@ -652,7 +652,9 @@ extern void EvalInitialise(char *szWeigh
+ pbc1 = BearoffInit ( NULL, BO_HEURISTIC, pfProgress );
+
+ /* read two-sided db from gnubg.bd */
+- gnubg_bearoff = BuildFilename("gnubg_ts0.bd");
++ /* For Debian, load dynamic databases from /var/lib/gnubg
++ instead. -- rra, 2008-02-16 */
++ gnubg_bearoff = BuildVarFilename ( "gnubg_ts0.bd" );
+ pbc2 = BearoffInit ( gnubg_bearoff, BO_IN_MEMORY | BO_MUST_BE_TWO_SIDED, NULL );
+ g_free(gnubg_bearoff);
+
+@@ -667,12 +669,12 @@ extern void EvalInitialise(char *szWeigh
+ "You can also generate other bearoff databases; see\n"
+ "README for more details\n\n" );
+
+- gnubg_bearoff_os = BuildFilename("gnubg_os.bd");
++ gnubg_bearoff_os = BuildVarFilename ( "gnubg_os.bd" );
+ /* init one-sided db */
+ pbcOS = BearoffInit ( gnubg_bearoff_os, BO_IN_MEMORY, NULL );
+ g_free(gnubg_bearoff_os);
+
+- gnubg_bearoff = BuildFilename("gnubg_ts.bd");
++ gnubg_bearoff = BuildVarFilename("gnubg_ts.bd");
+ /* init two-sided db */
+ pbcTS = BearoffInit ( gnubg_bearoff, BO_IN_MEMORY, NULL );
+ g_free(gnubg_bearoff);
+@@ -683,7 +685,7 @@ extern void EvalInitialise(char *szWeigh
+ char *fn;
+ char sz[10];
+ sprintf(sz, "hyper%1d.bd", i + 1);
+- fn = BuildFilename(sz);
++ fn = BuildVarFilename(sz);
+ apbcHyper[i] = BearoffInit(fn, BO_NONE, NULL);
+ g_free(fn);
+ }
+--- gnubg-0.90+20120429.orig/gtkwindows.c
++++ gnubg-0.90+20120429/gtkwindows.c
+@@ -391,7 +391,7 @@ WarningOK ( GtkWidget *pw, warningType w
+
+ extern int GTKShowWarning(warningType warning, GtkWidget *pwParent)
+ {
+- if (warnings[warning].warningEnabled)
++ if (fX && warnings[warning].warningEnabled)
+ {
+ char *buf;
+ GtkWidget *pwDialog, *pwMsg, *pwv, *label;
--- gnubg-0.90+20120429.orig/mkinstalldirs
+++ gnubg-0.90+20120429/mkinstalldirs
@@ -1,21 +1,36 @@
@@ -170,66 +218,6 @@
+# time-stamp-end: "; # UTC"
# End:
-# mkinstalldirs ends here
---- gnubg-0.90+20120429.orig/eval.c
-+++ gnubg-0.90+20120429/eval.c
-@@ -652,7 +652,9 @@ extern void EvalInitialise(char *szWeigh
- pbc1 = BearoffInit ( NULL, BO_HEURISTIC, pfProgress );
-
- /* read two-sided db from gnubg.bd */
-- gnubg_bearoff = BuildFilename("gnubg_ts0.bd");
-+ /* For Debian, load dynamic databases from /var/lib/gnubg
-+ instead. -- rra, 2008-02-16 */
-+ gnubg_bearoff = BuildVarFilename ( "gnubg_ts0.bd" );
- pbc2 = BearoffInit ( gnubg_bearoff, BO_IN_MEMORY | BO_MUST_BE_TWO_SIDED, NULL );
- g_free(gnubg_bearoff);
-
-@@ -667,12 +669,12 @@ extern void EvalInitialise(char *szWeigh
- "You can also generate other bearoff databases; see\n"
- "README for more details\n\n" );
-
-- gnubg_bearoff_os = BuildFilename("gnubg_os.bd");
-+ gnubg_bearoff_os = BuildVarFilename ( "gnubg_os.bd" );
- /* init one-sided db */
- pbcOS = BearoffInit ( gnubg_bearoff_os, BO_IN_MEMORY, NULL );
- g_free(gnubg_bearoff_os);
-
-- gnubg_bearoff = BuildFilename("gnubg_ts.bd");
-+ gnubg_bearoff = BuildVarFilename("gnubg_ts.bd");
- /* init two-sided db */
- pbcTS = BearoffInit ( gnubg_bearoff, BO_IN_MEMORY, NULL );
- g_free(gnubg_bearoff);
-@@ -683,7 +685,7 @@ extern void EvalInitialise(char *szWeigh
- char *fn;
- char sz[10];
- sprintf(sz, "hyper%1d.bd", i + 1);
-- fn = BuildFilename(sz);
-+ fn = BuildVarFilename(sz);
- apbcHyper[i] = BearoffInit(fn, BO_NONE, NULL);
- g_free(fn);
- }
---- gnubg-0.90+20120429.orig/util.h
-+++ gnubg-0.90+20120429/util.h
-@@ -34,6 +34,9 @@ extern char *getDocDir( void );
- #define BuildFilename(file) g_build_filename(getPkgDataDir(), file, NULL)
- #define BuildFilename2(file1, file2) g_build_filename(getPkgDataDir(), file1, file2, NULL)
-
-+/* Added for Debian -- rra, 2008-02-16 */
-+#define BuildVarFilename(file) g_build_filename("/var/lib/gnubg", file, NULL)
-+
- extern void PrintSystemError(const char* message);
- extern void PrintError(const char* message);
- extern FILE *GetTemporaryFile(const char *nameTemplate, char **retName);
---- gnubg-0.90+20120429.orig/set.c
-+++ gnubg-0.90+20120429/set.c
-@@ -1548,7 +1548,7 @@ extern void CommandSetRNGFile( char *sz
- SetRNG( rngSet, rngctxSet, RNG_FILE, sz );
- }
-
--extern void CommandSetRNGBBS( char *UNUSED(sz) ) {
-+extern void CommandSetRNGBBS( char *sz ) {
- #if HAVE_LIBGMP
- SetRNG( rngSet, rngctxSet, RNG_BBS, sz );
- #else
--- gnubg-0.90+20120429.orig/openurl.c
+++ gnubg-0.90+20120429/openurl.c
@@ -41,14 +41,8 @@ extern const gchar * get_web_browser (vo
@@ -249,3 +237,59 @@
return pch;
}
+--- gnubg-0.90+20120429.orig/play.c
++++ gnubg-0.90+20120429/play.c
+@@ -3287,7 +3287,9 @@ extern void CommandEndGame(char *UNUSED(
+ int fDisplay_store = fDisplay;
+ int fQuiet_store = fQuiet;
+ #if USE_BOARD3D
+- BoardData *bd = BOARD(pwBoard)->board_data;
++ BoardData *bd;
++ if (fX && pwBoard)
++ bd = BOARD(pwBoard)->board_data;
+ #endif
+ const evalcontext ec_quick = { FALSE, 0, FALSE, TRUE, 0.0 };
+ int manual_dice = (rngCurrent == RNG_MANUAL);
+@@ -3326,7 +3328,8 @@ extern void CommandEndGame(char *UNUSED(
+ }
+
+ #if USE_BOARD3D
+- SuspendDiceRolling(bd->rd);
++ if (fX)
++ SuspendDiceRolling(bd->rd);
+ #endif
+
+ fAutoGame = FALSE;
+@@ -3373,7 +3376,8 @@ extern void CommandEndGame(char *UNUSED(
+ }
+
+ #if USE_BOARD3D
+- ResumeDiceRolling(bd->rd);
++ if (fX)
++ ResumeDiceRolling(bd->rd);
+ #endif
+
+ if (!automaticTask)
+--- gnubg-0.90+20120429.orig/set.c
++++ gnubg-0.90+20120429/set.c
+@@ -1548,7 +1548,7 @@ extern void CommandSetRNGFile( char *sz
+ SetRNG( rngSet, rngctxSet, RNG_FILE, sz );
+ }
+
+-extern void CommandSetRNGBBS( char *UNUSED(sz) ) {
++extern void CommandSetRNGBBS( char *sz ) {
+ #if HAVE_LIBGMP
+ SetRNG( rngSet, rngctxSet, RNG_BBS, sz );
+ #else
+--- gnubg-0.90+20120429.orig/util.h
++++ gnubg-0.90+20120429/util.h
+@@ -34,6 +34,9 @@ extern char *getDocDir( void );
+ #define BuildFilename(file) g_build_filename(getPkgDataDir(), file, NULL)
+ #define BuildFilename2(file1, file2) g_build_filename(getPkgDataDir(), file1, file2, NULL)
+
++/* Added for Debian -- rra, 2008-02-16 */
++#define BuildVarFilename(file) g_build_filename("/var/lib/gnubg", file, NULL)
++
+ extern void PrintSystemError(const char* message);
+ extern void PrintError(const char* message);
+ extern FILE *GetTemporaryFile(const char *nameTemplate, char **retName);
Reply to: