[yquake2] 01/02: Add patch to override the default basedir instead of adding a path if SYSTEMWIDE is defined

Fabian Greffrath fabian at moszumanska.debian.org
Tue Oct 6 12:19:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

fabian pushed a commit to branch master
in repository yquake2.

commit 4f233f6cba61976bde6939e9601474a205a75467
Author: Fabian Greffrath <fabian at debian.org>
Date:   Tue Oct 6 14:12:18 2015 +0200

    Add patch to override the default basedir instead of adding a path if SYSTEMWIDE is defined
---
 debian/changelog                                   | 13 +++-
 ...DE-override-the-default-basedir-instead-o.patch | 91 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4f1d5a2..611454b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,19 @@
-yquake2 (5.31~dfsg1-2) UNRELEASED; urgency=medium
+yquake2 (5.31~dfsg1-2) unstable; urgency=medium
 
+  [ Simon McVittie ]
   * Move patches from upstream to the beginning of the patch series,
     and add DEP-3 metadata
   * Split rpath-avoidance into a separate patch
 
- -- Simon McVittie <smcv at debian.org>  Wed, 30 Sep 2015 08:21:33 +0100
+  [ Fabian Greffrath ]
+  * Add patch by Simon McVittie to override the default basedir
+    instead of adding a path if SYSTEMWIDE is defined.
+    + This lets "+set basedir" take precedence over the SYSTEMDIR,
+      which is useful if you have the demo and full-game data installed
+      in different base directories to be able to test the demo for
+      regressions.
+
+ -- Fabian Greffrath <fabian at debian.org>  Tue, 06 Oct 2015 14:07:59 +0200
 
 yquake2 (5.31~dfsg1-1) unstable; urgency=medium
 
diff --git a/debian/patches/0001-If-SYSTEMWIDE-override-the-default-basedir-instead-o.patch b/debian/patches/0001-If-SYSTEMWIDE-override-the-default-basedir-instead-o.patch
new file mode 100644
index 0000000..87ee3e9
--- /dev/null
+++ b/debian/patches/0001-If-SYSTEMWIDE-override-the-default-basedir-instead-o.patch
@@ -0,0 +1,91 @@
+From: Simon McVittie <smcv at debian.org>
+Date: Wed, 30 Sep 2015 09:28:08 +0100
+Subject: If SYSTEMWIDE, override the default basedir instead of adding a path
+
+This makes it behave a little more like -basedir in Quake 1 and
+fs_basepath in ioquake3.
+
+This lets "+set basedir" take precedence over the SYSTEMDIR,
+which is useful if you have the demo and full-game data installed
+in different base directories to be able to test the demo for
+regressions.
+
+Forwarded: https://github.com/yquake2/yquake2/issues/90#issuecomment-144327088
+---
+ src/common/filesystem.c | 37 ++++++++-----------------------------
+ 1 file changed, 8 insertions(+), 29 deletions(-)
+
+--- a/src/common/filesystem.c
++++ b/src/common/filesystem.c
+@@ -40,7 +40,7 @@
+ 
+ #ifdef SYSTEMWIDE
+  #ifndef SYSTEMDIR
+-  #define SYSTEMDIR "/usr/share/games/quake2/"
++  #define SYSTEMDIR "/usr/share/games/quake2"
+  #endif
+ #endif
+ 
+@@ -1381,25 +1381,6 @@ FS_AddHomeAsGameDirectory(char *dir)
+ 	FS_AddGameDirectory(gdir);
+ }
+ 
+-#ifdef SYSTEMWIDE
+-void
+-FS_AddSystemwideGameDirectory(char *dir)
+-{
+-	char gdir[MAX_OSPATH];
+-	char *datadir = SYSTEMDIR;
+-	int len = snprintf(gdir, sizeof(gdir), "%s/%s/", datadir, dir);
+-
+-	printf("Using %s to fetch paks\n", gdir);
+-
+-	if ((len > 0) && (len < sizeof(gdir)) && (gdir[len - 1] == '/'))
+-	{
+-		gdir[len - 1] = 0;
+-	}
+-
+-	FS_AddGameDirectory(gdir);
+-}
+-#endif
+-
+ void FS_AddBinaryDirAsGameDirectory(const char* dir)
+ {
+ 	char gdir[MAX_OSPATH];
+@@ -1690,10 +1671,6 @@ FS_SetGamedir(char *dir)
+ 			FS_AddGameDirectory(va("%s/%s", fs_cddir->string, dir));
+ 		}
+ 
+-#ifdef SYSTEMWIDE
+-		FS_AddSystemwideGameDirectory(dir);
+-#endif
+-
+ 		FS_AddGameDirectory(va("%s/%s", fs_basedir->string, dir));
+ 		FS_AddBinaryDirAsGameDirectory(dir);
+ 		FS_AddHomeAsGameDirectory(dir);
+@@ -2081,7 +2058,13 @@ FS_InitFilesystem(void)
+ 	Cmd_AddCommand("dir", FS_Dir_f);
+ 
+ 	/* basedir <path> Allows the game to run from outside the data tree.  */
+-	fs_basedir = Cvar_Get("basedir", ".", CVAR_NOSET);
++	fs_basedir = Cvar_Get("basedir",
++#ifdef SYSTEMWIDE
++		SYSTEMDIR,
++#else
++		".",
++#endif
++		CVAR_NOSET);
+ 
+ 	/* cddir <path> Logically concatenates the cddir after the basedir to
+ 	   allow the game to run from outside the data tree. */
+@@ -2101,10 +2084,6 @@ FS_InitFilesystem(void)
+ 	/* Current directory. */
+ 	fs_homepath = Cvar_Get("homepath", Sys_GetCurrentDirectory(), CVAR_NOSET);
+ 
+-#ifdef SYSTEMWIDE
+-	FS_AddSystemwideGameDirectory(BASEDIRNAME);
+-#endif
+-
+ 	/* Add baseq2 to search path. */
+ 	FS_AddGameDirectory(va("%s/" BASEDIRNAME, fs_basedir->string));
+ 	FS_AddBinaryDirAsGameDirectory(BASEDIRNAME);
diff --git a/debian/patches/series b/debian/patches/series
index 56b1671..bfe3e5a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ Remove-unwanted-rpaths-from-LDFLAGS.patch
 Fix-spelling-errors-detected-by-lintian.patch
 Optionally-link-libopenal-at-compile-time.patch
 Add-BUILDDATE-macro-which-overrides-__DATE__-for-rep.patch
+0001-If-SYSTEMWIDE-override-the-default-basedir-instead-o.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/yquake2.git



More information about the Pkg-games-commits mailing list