r526 - in packages/cube/trunk/debian: . patches
Gonéri Le Bouder
goneri-guest at costa.debian.org
Mon Apr 17 12:54:33 UTC 2006
Author: goneri-guest
Date: 2006-04-17 12:54:32 +0000 (Mon, 17 Apr 2006)
New Revision: 526
Modified:
packages/cube/trunk/debian/README.Debian
packages/cube/trunk/debian/patches/04_load_personal_setting.patch
Log:
cube can read /etc/cube/config/cfg
Modified: packages/cube/trunk/debian/README.Debian
===================================================================
--- packages/cube/trunk/debian/README.Debian 2006-04-17 12:34:09 UTC (rev 525)
+++ packages/cube/trunk/debian/README.Debian 2006-04-17 12:54:32 UTC (rev 526)
@@ -1,5 +1,7 @@
Personal setting:
If you want to create your own setting file, you can store it in
- $HOME/.cube/config.cfg
-or
- $HOME/.cube/autoexec.cfg
+~/.cube/config.cfg
+or:
+~/.cube/autoexec.cfg
+
+Cube also try to read /etc/cube/config.cfg if ~/.cube/config.cfg doesn't exist.
Modified: packages/cube/trunk/debian/patches/04_load_personal_setting.patch
===================================================================
--- packages/cube/trunk/debian/patches/04_load_personal_setting.patch 2006-04-17 12:34:09 UTC (rev 525)
+++ packages/cube/trunk/debian/patches/04_load_personal_setting.patch 2006-04-17 12:54:32 UTC (rev 526)
@@ -7,19 +7,19 @@
@DPATCH@
diff -ru cube-2005.08.29.orig/src/main.cpp cube-2005.08.29/src/main.cpp
---- cube-2005.08.29.orig/src/main.cpp 2006-04-15 03:53:13.000000000 +0200
-+++ cube-2005.08.29/src/main.cpp 2006-04-15 04:08:55.000000000 +0200
+--- cube-2005.08.29.orig/src/main.cpp 2006-04-17 14:17:49.000000000 +0200
++++ cube-2005.08.29/src/main.cpp 2006-04-17 14:15:57.000000000 +0200
@@ -161,6 +161,19 @@
log("sound");
initsound();
-+
+// i try to load cfg from user home directory
++ char systemconfigcfg[] = "/etc/cube/config.cfg";
+ char *homedir = getenv("HOME");
+ char *personalconfigcfg;
+ char *personalautoexeccfg;
-+ personalconfigcfg = (char*)malloc(sizeof(char)*strlen(homedir)+30);
-+ personalautoexeccfg = (char*)malloc(sizeof(char)*strlen(homedir)+30);
++ personalconfigcfg = (char*)malloc(sizeof(char)*strlen(homedir)+18);
++ personalautoexeccfg = (char*)malloc(sizeof(char)*strlen(homedir)+20);
+ strcpy(personalconfigcfg,homedir);
+ strcat(personalconfigcfg,"/.cube/config.cfg");
+ strcpy(personalautoexeccfg,homedir);
@@ -29,13 +29,14 @@
log("cfg");
newmenu("frags\tpj\tping\tteam\tname");
newmenu("ping\tplr\tserver");
-@@ -169,8 +182,13 @@
+@@ -169,8 +182,14 @@
exec("data/prefabs.cfg");
exec("data/sounds.cfg");
exec("servers.cfg");
- if(!execfile("config.cfg")) execfile("data/defaults.cfg");
+ if(!execfile(personalconfigcfg))
-+ if(!execfile("config.cfg")) execfile("data/defaults.cfg");
++ if(!execfile(systemconfigcfg))
++ if(!execfile("config.cfg")) execfile("data/defaults.cfg");
exec("autoexec.cfg");
+ exec(personalautoexeccfg);
+ delete (personalconfigcfg);
More information about the Pkg-games-devel
mailing list