Bug#693244: etw: doesn't save and load important configurations
Markus Koschany
apo at gambaru.de
Wed Nov 14 17:15:32 UTC 2012
tags 693244 patch
thanks
Attached is the patch as a debdiff. I will looking for a sponsor now.
-------------- next part --------------
diff -u etw-3.6+svn140/debian/changelog etw-3.6+svn140/debian/changelog
--- etw-3.6+svn140/debian/changelog
+++ etw-3.6+svn140/debian/changelog
@@ -1,3 +1,15 @@
+etw (3.6+svn140-4) unstable; urgency=low
+
+ * New Maintainer. (Closes: #544922)
+ * Eat the Whistle will be maintained in a Git repository from now on.
+ Change the Vcs-fields in debian/control accordingly.
+ * debian/patches:
+ Add 0005-Change-conf-and-replay-path.patch.
+ Save and load configuration and replays in $HOME/.etw/ instead of
+ /usr/share/games/etw and stop failing silently. (Closes: #693244)
+
+ -- Markus Koschany <apo at gambaru.de> Sun, 14 Nov 2012 16:21:55 +0100
+
etw (3.6+svn140-3) unstable; urgency=low
* Team upload.
diff -u etw-3.6+svn140/debian/control etw-3.6+svn140/debian/control
--- etw-3.6+svn140/debian/control
+++ etw-3.6+svn140/debian/control
@@ -2,12 +2,12 @@
Section: games
Priority: optional
Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
-Uploaders: Sam Hocevar <sho at debian.org>, Barry deFreese <bdefreese at debian.org>
+Uploaders: Markus Koschany <apo at gambaru.de>
Build-Depends: debhelper (>= 5.0), quilt, libgtk2.0-dev, libsdl1.2-dev, sharutils
Standards-Version: 3.9.1
Homepage: http://www.ggsoft.org/etw/
-Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/etw/
-Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/etw/?op=log
+Vcs-Git: git://git.debian.org/pkg-games/etw.git
+Vcs-Browser: http://git.debian.org/?p=pkg-games/etw.git;a=summary
Package: etw
Architecture: any
diff -u etw-3.6+svn140/debian/patches/series etw-3.6+svn140/debian/patches/series
--- etw-3.6+svn140/debian/patches/series
+++ etw-3.6+svn140/debian/patches/series
@@ -1,3 +1,4 @@
+0005-Change-conf-and-replay-path.patch
000_upstream_changelog.diff
100_pthread_linking.diff
200_datadir.diff
only in patch2:
unchanged:
--- etw-3.6+svn140.orig/debian/patches/0005-Change-conf-and-replay-path.patch
+++ etw-3.6+svn140/debian/patches/0005-Change-conf-and-replay-path.patch
@@ -0,0 +1,84 @@
+From: Markus Koschany <apo at gambaru.de>
+Date: Sat, 10 Nov 2012 14:22:44 +0100
+Subject: Change conf and replay path
+
+The default game directory of etw is /usr/share/games/etw. The game also tries
+to store variable game data like replays in there hence users couldn't use
+important functions of the game in the past. This patch changes the
+behaviour. From now on configuration and replays are saved permanently
+in $HOME/.etw/
+---
+ etw/menu_config.c | 8 +++++++-
+ etw/replay.c | 24 +++++++++++++-----------
+ 2 files changed, 20 insertions(+), 12 deletions(-)
+
+--- a/etw/menu_config.c
++++ b/etw/menu_config.c
+@@ -392,9 +392,15 @@ void load_config(FILE *f)
+ void read_menu_config(void)
+ {
+ FILE *f;
++ char path[1024];
++ sprintf(path, "%s/%s", getenv("HOME"), ".etw/etw.cfg" );
+ D(bug("Reading configuration...\n"/*-*/));
+
+- f=fopen("etw.cfg"/*-*/,"r");
++ f=fopen(path/*-*/,"r");
++
++ if (f == NULL) {
++ f=fopen("etw.cfg"/*-*/,"r");
++ }
+
+ newpitches=CheckNewPitches();
+
+--- a/etw/replay.c
++++ b/etw/replay.c
+@@ -892,35 +892,37 @@ void EndReplay(void)
+
+ void SaveReplay(void)
+ {
+- char buffer[16] = "t/replay.001";
++ char buffer[16] = "replay.001";
++ char path[1024];
+ extern struct team_disk leftteam_dk, rightteam_dk;
+ FILE *f;
+ int i, j;
+ WORD highsize;
+ struct MatchStatus *m;
+-
++ sprintf(path, "%s%s", TEMP_DIR, buffer);
+
+ if(real_counter <= match[StartReplaySet].ReplayCounter)
+ return;
+
+- while ((f=fopen(buffer,"r"))) {
++ while ((f=fopen(path,"r"))) {
+ fclose(f);
+- buffer[11]++;
++ buffer[9]++;
+
+- if(buffer[11] > '9')
++ if(buffer[9] > '9')
+ {
+- buffer[11] = '0';
+- buffer[10]++;
++ buffer[9] = '0';
++ buffer[8]++;
+
+- if(buffer[10] > '9')
++ if(buffer[8] > '9')
+ {
+- buffer[10] = '0';
+- buffer[9]++;
++ buffer[8] = '0';
++ buffer[7]++;
+ }
+ }
++ sprintf(path, "%s%s", TEMP_DIR, buffer);
+ }
+
+- f = fopen(buffer,"wb");
++ f = fopen(path,"wb");
+ if (!f)
+ return;
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20121114/fd85a5ad/attachment.pgp>
More information about the Pkg-games-devel
mailing list