fix scorefile access

This commit is contained in:
naddy 2006-11-07 15:14:30 +00:00
parent 83e39527d2
commit c9f1741607
4 changed files with 40 additions and 23 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.34 2006/09/18 11:50:40 espie Exp $
# $OpenBSD: Makefile,v 1.35 2006/11/07 15:14:30 naddy Exp $
COMMENT= "game where you deal drugs on the streets of NY"
DISTNAME= dopewars-1.5.7
PKGNAME= ${DISTNAME}p6
PKGNAME= ${DISTNAME}p7
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dopewars/}
@ -22,6 +22,7 @@ LIB_DEPENDS+= glib-2.0::devel/glib2
BUILD_DEPENDS+= :pkgconfig-*:devel/pkgconfig
USE_GMAKE= Yes
USE_LIBTOOL= Yes
AUTOCONF_VERSION=2.13
CONFIGURE_STYLE= autoconf
CONFIGURE_ARGS+= --enable-nls \

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-config_h_in,v 1.1 2003/12/24 04:00:38 brad Exp $
--- config.h.in.orig 2002-06-24 13:49:01.000000000 -0400
+++ config.h.in 2003-12-23 22:32:00.000000000 -0500
@@ -269,9 +269,6 @@
/* Define if dopewars should use TCP/IP networking to connect to servers */
#undef NETWORKING
-/* The directory containing the high score file and docs */
-#undef DATADIR
-
/* The directory containing locale files */
#undef LOCALEDIR

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-src_Makefile_in,v 1.3 2005/02/13 18:31:15 alek Exp $
$OpenBSD: patch-src_Makefile_in,v 1.4 2006/11/07 15:14:31 naddy Exp $
--- src/Makefile.in.orig Tue Jun 25 19:08:23 2002
+++ src/Makefile.in Sun Feb 13 19:23:52 2005
+++ src/Makefile.in Tue Nov 7 16:00:56 2006
@@ -133,7 +133,7 @@ plugindir = @plugindir@
@CURSESPORT_TRUE@CURSESPORTSUBDIR = @CURSESPORT_TRUE@cursesport
@ -17,7 +17,7 @@ $OpenBSD: patch-src_Makefile_in,v 1.3 2005/02/13 18:31:15 alek Exp $
-INCLUDES = -I../intl -I${srcdir} -I.. @GTK_CFLAGS@
-DEFS = @DEFS@
+INCLUDES = -I${srcdir} -I.. @GLIB_CFLAGS@ @GTK_CFLAGS@
+DEFS = @DEFS@ -DDATADIR="\"/var/games\""
+DEFS = @DEFS@ -DSCOREDIR="\"/var/games\""
PIXDIR = ${DESTDIR}${datadir}/pixmaps
DOPEDIR = ${DESTDIR}${bindir}
DOPEBIN = ${DOPEDIR}/dopewars

View File

@ -1,7 +1,35 @@
$OpenBSD: patch-src_dopewars_c,v 1.1 2005/02/13 18:31:15 alek Exp $
--- src/dopewars.c.orig Sun Feb 13 18:08:58 2005
+++ src/dopewars.c Sun Feb 13 18:09:01 2005
@@ -2574,16 +2574,18 @@ void GeneralStartup(int argc, char *argv
$OpenBSD: patch-src_dopewars_c,v 1.2 2006/11/07 15:14:31 naddy Exp $
--- src/dopewars.c.orig Mon Jun 24 19:48:39 2002
+++ src/dopewars.c Tue Nov 7 16:00:20 2006
@@ -2217,8 +2217,7 @@ gchar *GetDocIndex(void)
path = g_strdup_printf("file://%s\\%s", bindir, indexfile);
g_free(bindir);
#else
- path = g_strdup_printf("file://%s/doc/%s-%s/%s", DATADIR, PACKAGE,
- VERSION, indexfile);
+ path = g_strdup_printf("file://%s/doc/%s/%s", DATADIR, PACKAGE, indexfile);
#endif
return path;
}
@@ -2419,7 +2418,7 @@ Drug dealing game based on \"Drug Wars\"
client (GTK+ or Win32)\n\
-t, --text-client force the use of a text-mode client (curses) (by\n\
default, a windowed client is used when possible)\n\
- -C, --convert=FILE convert an \"old format\" score file to the new format\n"), DATADIR);
+ -C, --convert=FILE convert an \"old format\" score file to the new format\n"), SCOREDIR);
PluginHelp();
g_print(_(" -h, --help display this help information\n\
-v, --version output version information and exit\n\n\
@@ -2457,7 +2456,7 @@ Drug dealing game based on \"Drug Wars\"
-h display this help information\n\
-v output version information and exit\n\n\
dopewars is Copyright (C) Ben Webb 1998-2002, and released under the GNU GPL\n\
-Report bugs to the author at ben@bellatrix.pcl.ox.ac.uk\n"), DATADIR);
+Report bugs to the author at ben@bellatrix.pcl.ox.ac.uk\n"), SCOREDIR);
#endif
}
@@ -2574,16 +2573,18 @@ void GeneralStartup(int argc, char *argv
{
gchar *priv_hiscore;
@ -11,7 +39,8 @@ $OpenBSD: patch-src_dopewars_c,v 1.1 2005/02/13 18:31:15 alek Exp $
+
/* First, open the hard-coded high score file with possibly
* elevated privileges */
priv_hiscore = g_strdup_printf("%s/dopewars.sco", DATADIR);
- priv_hiscore = g_strdup_printf("%s/dopewars.sco", DATADIR);
+ priv_hiscore = g_strdup_printf("%s/dopewars.sco", SCOREDIR);
HiScoreFile = g_strdup(priv_hiscore);
- OpenHighScoreFile();
+ if (!WantConvert) {