r4123 - packages/trunk/gradle-unison/debian/patches

Miriam Ruiz baby-guest at alioth.debian.org
Fri Sep 7 23:33:01 UTC 2007


Author: baby-guest
Date: 2007-09-07 23:33:01 +0000 (Fri, 07 Sep 2007)
New Revision: 4123

Modified:
   packages/trunk/gradle-unison/debian/patches/directories.patch
   packages/trunk/gradle-unison/debian/patches/homedir.patch
Log:
user files now are saved in the user directory
bullets are taken from abs path



Modified: packages/trunk/gradle-unison/debian/patches/directories.patch
===================================================================
--- packages/trunk/gradle-unison/debian/patches/directories.patch	2007-09-07 23:29:34 UTC (rev 4122)
+++ packages/trunk/gradle-unison/debian/patches/directories.patch	2007-09-07 23:33:01 UTC (rev 4123)
@@ -3,8 +3,8 @@
 
 Index: gradle-unison-0.10.dfsg1/src/init.d
 ===================================================================
---- gradle-unison-0.10.dfsg1.orig/src/init.d	2007-09-07 18:25:54.000000000 +0000
-+++ gradle-unison-0.10.dfsg1/src/init.d	2007-09-07 18:28:41.000000000 +0000
+--- gradle-unison-0.10.dfsg1.orig/src/init.d	2007-09-07 22:52:38.000000000 +0000
++++ gradle-unison-0.10.dfsg1/src/init.d	2007-09-07 22:55:40.000000000 +0000
 @@ -18,25 +18,25 @@
  
  void grpINIT()
@@ -45,10 +45,28 @@
  
  	volumeSNDse(vol_se);
  	volumeSNDmusic(vol_music);
+@@ -47,7 +47,7 @@
+ 	int cnt = 0;
+ 	char[][] bullet_list;
+ 
+-	bullet_list = listdir("./bullet/");
++	bullet_list = listdir("/usr/share/games/gradle-unison/bullet/");
+ 	foreach(char[] fname; bullet_list){
+ 		cnt++;
+ 	}
+@@ -59,7 +59,7 @@
+ 	cnt = 0;
+ 	foreach(char[] fname; bullet_list){
+ 		//writefln("%03d:%s", cnt, fname);
+-		readBulletcommandParser(cnt, "./bullet/" ~ fname);
++		readBulletcommandParser(cnt, "/usr/share/games/gradle-unison/bullet/" ~ fname);
+ 		cnt++;
+ 	}
+ 
 Index: gradle-unison-0.10.dfsg1/src/main.d
 ===================================================================
---- gradle-unison-0.10.dfsg1.orig/src/main.d	2007-09-07 18:28:41.000000000 +0000
-+++ gradle-unison-0.10.dfsg1/src/main.d	2007-09-07 18:28:41.000000000 +0000
+--- gradle-unison-0.10.dfsg1.orig/src/main.d	2007-09-07 22:55:05.000000000 +0000
++++ gradle-unison-0.10.dfsg1/src/main.d	2007-09-07 22:55:06.000000000 +0000
 @@ -149,7 +149,7 @@
  	configINIT();
  	sysinfoINIT(256);
@@ -60,8 +78,8 @@
  	game_exec = 1;
 Index: gradle-unison-0.10.dfsg1/src/util_sdl.d
 ===================================================================
---- gradle-unison-0.10.dfsg1.orig/src/util_sdl.d	2007-09-07 18:28:41.000000000 +0000
-+++ gradle-unison-0.10.dfsg1/src/util_sdl.d	2007-09-07 18:28:41.000000000 +0000
+--- gradle-unison-0.10.dfsg1.orig/src/util_sdl.d	2007-09-07 22:55:05.000000000 +0000
++++ gradle-unison-0.10.dfsg1/src/util_sdl.d	2007-09-07 22:55:06.000000000 +0000
 @@ -106,7 +106,7 @@
  	SDL_ShowCursor(SDL_DISABLE);
  

Modified: packages/trunk/gradle-unison/debian/patches/homedir.patch
===================================================================
--- packages/trunk/gradle-unison/debian/patches/homedir.patch	2007-09-07 23:29:34 UTC (rev 4122)
+++ packages/trunk/gradle-unison/debian/patches/homedir.patch	2007-09-07 23:33:01 UTC (rev 4123)
@@ -3,67 +3,96 @@
 
 Index: gradle-unison-0.10.dfsg1/src/gctrl.d
 ===================================================================
---- gradle-unison-0.10.dfsg1.orig/src/gctrl.d	2007-09-07 18:28:22.000000000 +0000
-+++ gradle-unison-0.10.dfsg1/src/gctrl.d	2007-09-07 18:28:41.000000000 +0000
-@@ -155,8 +155,8 @@
+--- gradle-unison-0.10.dfsg1.orig/src/gctrl.d	2007-09-07 22:46:54.000000000 +0000
++++ gradle-unison-0.10.dfsg1/src/gctrl.d	2007-09-07 22:49:54.000000000 +0000
+@@ -10,6 +10,8 @@
+ private import std.math;
+ private import std.file;
+ private import std.path;
++private import std.string;
++private import std.c.stdlib;
+ private import SDL;
+ private import util_sdl;
+ private import util_snd;
+@@ -116,6 +118,19 @@
+ private const int RANKING_TIME = 30 * ONE_SEC;
+ private const int RANKING_TIME2 = RESULT_TIME - (3 * ONE_SEC);
+ 
++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) ~ "/.gradle-unison";
++	try {
++		mkdir(dir);
++	} catch (FileException e) {
++	}
++	return dir;
++}
++
+ void TSKgctrl(int id)
+ {
+ 	void game_init(int id){
+@@ -155,8 +170,8 @@
  	}
  
  	void init_highscore(){
 -		if(exists("score.dat")){
 -			hi_score = cast(int[])read("score.dat");
-+		if(exists("/tmp/score.dat")){
-+			hi_score = cast(int[])read("/tmp/score.dat");
++		if(exists(pref_dir() ~ "/" ~ "score.dat")){
++			hi_score = cast(int[])read(pref_dir() ~ "/" ~ "score.dat");
  		}else{
  			hi_score.length = RANKING_MAX * RANKING_RECORD;
  			for(int i = 0; i < RANKING_MAX; i++){
-@@ -165,7 +165,7 @@
+@@ -165,7 +180,7 @@
  				hi_score[i * RANKING_RECORD + RANKING_PHASE] = 1;
  				hi_score[i * RANKING_RECORD + RANKING_CHAIN] = 1;
  			}
 -			write("score.dat", cast(void[])hi_score);
-+			write("/tmp/score.dat", cast(void[])hi_score);
++			write(pref_dir() ~ "/" ~ "score.dat", cast(void[])hi_score);
  		}
  		debug{
  			for(int i = 0; i < RANKING_MAX; i++){
-@@ -194,7 +194,7 @@
+@@ -194,7 +209,7 @@
  				hi_score[i * RANKING_RECORD + RANKING_PTIME] = time;
  				hi_score[i * RANKING_RECORD + RANKING_PHASE] = phase;
  				hi_score[i * RANKING_RECORD + RANKING_CHAIN] = max_chain;
 -				write("score.dat", cast(void[])hi_score);
-+				write("/tmp/score.dat", cast(void[])hi_score);
++				write(pref_dir() ~ "/" ~ "score.dat", cast(void[])hi_score);
  				break;
  			}
  		}
-@@ -219,20 +219,20 @@
+@@ -219,20 +234,20 @@
  		}
  		replay_ok = 0;
  		for(int i = 0; i < replay_file.length; i++){
 -			if(fnmatch(replay_file[i], "normal_rec0.rep")){
 -				replay_data = cast(int[])read("normal_rec0.rep");
-+			if(fnmatch(replay_file[i], "/tmp/normal_rec0.rep")){
-+				replay_data = cast(int[])read("/tmp/normal_rec0.rep");
++			if(fnmatch(replay_file[i], pref_dir() ~ "/" ~ "normal_rec0.rep")){
++				replay_data = cast(int[])read(pref_dir() ~ "/" ~ "normal_rec0.rep");
  				replay_ok++;
  			}
 -			if(fnmatch(replay_file[i], "normal_rec1.rep")){
 -				replay_move = cast(float[])read("normal_rec1.rep");
-+			if(fnmatch(replay_file[i], "/tmp/normal_rec1.rep")){
-+				replay_move = cast(float[])read("/tmp/normal_rec1.rep");
++			if(fnmatch(replay_file[i], pref_dir() ~ "/" ~ "normal_rec1.rep")){
++				replay_move = cast(float[])read(pref_dir() ~ "/" ~ "normal_rec1.rep");
  				replay_ok++;
  			}
 -			if(fnmatch(replay_file[i], "normal_rec2.rep")){
 -				replay_trgs = cast(int[])read("normal_rec2.rep");
-+			if(fnmatch(replay_file[i], "/tmp/normal_rec2.rep")){
-+				replay_trgs = cast(int[])read("/tmp/normal_rec2.rep");
++			if(fnmatch(replay_file[i], pref_dir() ~ "/" ~ "normal_rec2.rep")){
++				replay_trgs = cast(int[])read(pref_dir() ~ "/" ~ "normal_rec2.rep");
  				replay_ok++;
  			}
 -			if(fnmatch(replay_file[i], "normal_rec3.rep")){
 -				replay_bullet = cast(int[])read("normal_rec3.rep");
-+			if(fnmatch(replay_file[i], "/tmp/normal_rec3.rep")){
-+				replay_bullet = cast(int[])read("/tmp/normal_rec3.rep");
++			if(fnmatch(replay_file[i], pref_dir() ~ "/" ~ "normal_rec3.rep")){
++				replay_bullet = cast(int[])read(pref_dir() ~ "/" ~ "normal_rec3.rep");
  				replay_ok++;
  			}
  		}
-@@ -251,10 +251,10 @@
+@@ -251,10 +266,10 @@
  		replay_data[7] = warp_cnt;
  		replay_data[8] = energy_used;
  		replay_data[9] = max_chain;
@@ -71,10 +100,10 @@
 -		write("normal_rec1.rep", cast(void[])replay_move);
 -		write("normal_rec2.rep", cast(void[])replay_trgs);
 -		write("normal_rec3.rep", cast(void[])replay_bullet);
-+		write("/tmp/normal_rec0.rep", cast(void[])replay_data);
-+		write("/tmp/normal_rec1.rep", cast(void[])replay_move);
-+		write("/tmp/normal_rec2.rep", cast(void[])replay_trgs);
-+		write("/tmp/normal_rec3.rep", cast(void[])replay_bullet);
++		write(pref_dir() ~ "/" ~ "normal_rec0.rep", cast(void[])replay_data);
++		write(pref_dir() ~ "/" ~ "normal_rec1.rep", cast(void[])replay_move);
++		write(pref_dir() ~ "/" ~ "normal_rec2.rep", cast(void[])replay_trgs);
++		write(pref_dir() ~ "/" ~ "normal_rec3.rep", cast(void[])replay_bullet);
  		replay_normal = 1;
  ++/
  	}




More information about the Pkg-games-commits mailing list