r3885 - packages/trunk/gunroar/debian/patches

Peter De Wachter pdewacht-guest at alioth.debian.org
Sun Aug 26 22:52:24 UTC 2007


Author: pdewacht-guest
Date: 2007-08-26 22:52:24 +0000 (Sun, 26 Aug 2007)
New Revision: 3885

Removed:
   packages/trunk/gunroar/debian/patches/05_put_replay_dir_in_home.diff
Modified:
   packages/trunk/gunroar/debian/patches/03_put_prefs_in_home_dir.diff
   packages/trunk/gunroar/debian/patches/series
Log:
do the dotfile thing the same way as in the other ABA Games


Modified: packages/trunk/gunroar/debian/patches/03_put_prefs_in_home_dir.diff
===================================================================
--- packages/trunk/gunroar/debian/patches/03_put_prefs_in_home_dir.diff	2007-08-26 22:45:56 UTC (rev 3884)
+++ packages/trunk/gunroar/debian/patches/03_put_prefs_in_home_dir.diff	2007-08-26 22:52:24 UTC (rev 3885)
@@ -3,32 +3,43 @@
 
 Sun Aug 26 01:06:53 CEST 2007  pdewacht at gmail.com
   * 03_put_prefs_in_home_dir
-diff -rN -u old-gr/src/abagames/gr/prefmanager.d new-gr/src/abagames/gr/prefmanager.d
---- old-gr/src/abagames/gr/prefmanager.d	2007-08-26 01:08:36.000000000 +0200
-+++ new-gr/src/abagames/gr/prefmanager.d	2007-08-26 01:08:36.000000000 +0200
-@@ -6,6 +6,8 @@
+Index: gunroar_0.15.dfsg1/src/abagames/gr/prefmanager.d
+===================================================================
+--- gunroar_0.15.dfsg1.orig/src/abagames/gr/prefmanager.d	2007-08-27 00:15:52.000000000 +0200
++++ gunroar_0.15.dfsg1/src/abagames/gr/prefmanager.d	2007-08-27 00:18:01.000000000 +0200
+@@ -6,6 +6,9 @@
  module abagames.gr.prefmanager;
  
  private import std.stream;
 +private import std.c.stdlib;
 +private import std.string;
++private import std.file;
  private import abagames.util.prefmanager;
  private import abagames.gr.gamemanager;
  
-@@ -16,18 +18,22 @@
+@@ -16,18 +19,31 @@
   private:
    static const int VERSION_NUM = 14;
    static const int VERSION_NUM_13 = 13;
 -  static const char[] PREF_FILE = "gr.prf";
-+  static const char[] PREF_FILE = ".gunroar.prf";
++  static const char[] PREF_FILE = "gunroar.prf";
    PrefData _prefData;
  
    public this() {
      _prefData = new PrefData;
    }
  
-+  public char[] pref_file() {
-+    return format("%s/%s", std.string.toString(getenv("HOME")), PREF_FILE);
++  public static char[] pref_dir()
++  {
++    char * home = getenv("HOME");
++    if (home is null)
++      throw new Error("HOME environment variable not defined");
++    char[] dir = std.string.toString(home) ~ "/.gunroar";
++    try {
++      mkdir(dir);
++    } catch (FileException e) {
++    }
++    return dir;
 +  }
 +
    public void load() {
@@ -36,17 +47,53 @@
      try {
        int ver;
 -      fd.open(PREF_FILE);
-+      fd.open(pref_file());
++      fd.open(pref_dir() ~ "/" ~ PREF_FILE);
        fd.read(ver);
        if (ver == VERSION_NUM_13)
          _prefData.loadVer13(fd);
-@@ -45,7 +51,7 @@
+@@ -45,7 +61,7 @@
  
    public void save() {
      auto File fd = new File;
 -    fd.create(PREF_FILE);
-+    fd.create(pref_file());
++    fd.create(pref_dir() ~ "/" ~ PREF_FILE);
      fd.write(VERSION_NUM);
      _prefData.save(fd);
      fd.close();
-
+Index: gunroar_0.15.dfsg1/src/abagames/gr/replay.d
+===================================================================
+--- gunroar_0.15.dfsg1.orig/src/abagames/gr/replay.d	2007-08-27 00:15:52.000000000 +0200
++++ gunroar_0.15.dfsg1/src/abagames/gr/replay.d	2007-08-27 00:15:56.000000000 +0200
+@@ -12,13 +12,13 @@
+ private import abagames.util.sdl.mouse;
+ private import abagames.gr.gamemanager;
+ private import abagames.gr.mouseandpad;
++private import abagames.gr.prefmanager;
+ 
+ /**
+  * Save/Load a replay data.
+  */
+ public class ReplayData {
+  public:
+-  static const char[] dir = "replay";
+   static const int VERSION_NUM = 11;
+   InputRecord!(PadState) padInputRecord;
+   InputRecord!(TwinStickState) twinStickInputRecord;
+@@ -32,7 +32,7 @@
+ 
+   public void save(char[] fileName) {
+     auto File fd = new File;
+-    fd.create(dir ~ "/" ~ fileName);
++    fd.create(PrefManager.pref_dir() ~ "/" ~ fileName);
+     fd.write(VERSION_NUM);
+     fd.write(seed);
+     fd.write(score);
+@@ -59,7 +59,7 @@
+ 
+   public void load(char[] fileName) {
+     auto File fd = new File;
+-    fd.open(dir ~ "/" ~ fileName);
++    fd.open(PrefManager.pref_dir() ~ "/" ~ fileName);
+     int ver;
+     fd.read(ver);
+     if (ver != VERSION_NUM)

Deleted: packages/trunk/gunroar/debian/patches/05_put_replay_dir_in_home.diff
===================================================================
--- packages/trunk/gunroar/debian/patches/05_put_replay_dir_in_home.diff	2007-08-26 22:45:56 UTC (rev 3884)
+++ packages/trunk/gunroar/debian/patches/05_put_replay_dir_in_home.diff	2007-08-26 22:52:24 UTC (rev 3885)
@@ -1,56 +0,0 @@
-# Copyright (C) 2007  Peter De Wachter <pdewacht at gmail.com>
-# Distributed under the same license as the game. See debian/copyright.
-
-Sun Aug 26 01:23:00 CEST 2007  pdewacht at gmail.com
-  * 05_put_replay_dir_in_home
-diff -rN -u old-gr/src/abagames/gr/replay.d new-gr/src/abagames/gr/replay.d
---- old-gr/src/abagames/gr/replay.d	2007-08-26 01:23:51.000000000 +0200
-+++ new-gr/src/abagames/gr/replay.d	2007-08-26 01:23:51.000000000 +0200
-@@ -6,6 +6,9 @@
- module abagames.gr.replay;
- 
- private import std.stream;
-+private import std.file;
-+private import std.c.stdlib;
-+private import std.string;
- private import abagames.util.sdl.recordableinput;
- private import abagames.util.sdl.pad;
- private import abagames.util.sdl.twinstick;
-@@ -18,7 +21,6 @@
-  */
- public class ReplayData {
-  public:
--  static const char[] dir = "replay";
-   static const int VERSION_NUM = 11;
-   InputRecord!(PadState) padInputRecord;
-   InputRecord!(TwinStickState) twinStickInputRecord;
-@@ -30,9 +32,18 @@
-   int gameMode;
-  private:
- 
-+  char[] dir() {
-+    char[] dir = std.string.toString(getenv("HOME")) ~ "/.gunroar";
-+    try {
-+      mkdir(dir);
-+    } catch (FileException e) {
-+    }
-+    return dir;
-+  }
-+
-   public void save(char[] fileName) {
-     auto File fd = new File;
--    fd.create(dir ~ "/" ~ fileName);
-+    fd.create(dir() ~ "/" ~ fileName);
-     fd.write(VERSION_NUM);
-     fd.write(seed);
-     fd.write(score);
-@@ -59,7 +70,7 @@
- 
-   public void load(char[] fileName) {
-     auto File fd = new File;
--    fd.open(dir ~ "/" ~ fileName);
-+    fd.open(dir() ~ "/" ~ fileName);
-     int ver;
-     fd.read(ver);
-     if (ver != VERSION_NUM)
-

Modified: packages/trunk/gunroar/debian/patches/series
===================================================================
--- packages/trunk/gunroar/debian/patches/series	2007-08-26 22:45:56 UTC (rev 3884)
+++ packages/trunk/gunroar/debian/patches/series	2007-08-26 22:52:24 UTC (rev 3885)
@@ -2,6 +2,5 @@
 02_d_language_changes.diff
 03_put_prefs_in_home_dir.diff
 04_adapt_build_file_to_linux.diff
-05_put_replay_dir_in_home.diff
 directories.patch
 windowed.patch




More information about the Pkg-games-commits mailing list