[jstest-gtk] 01/03: Hard-code the data directory

Stephen Kitt skitt at moszumanska.debian.org
Tue Jan 10 08:08:27 UTC 2017


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

skitt pushed a commit to branch master
in repository jstest-gtk.

commit 1cce493935161f41321f6ea01b91647465b0fffa
Author: Stephen Kitt <steve at sk2.org>
Date:   Tue Jan 10 09:03:56 2017 +0100

    Hard-code the data directory
---
 debian/changelog             |  7 +++++++
 debian/patches/datadir.patch | 37 +++++++++++++++++++++++++++++++++++++
 debian/patches/series        |  1 +
 3 files changed, 45 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 99181ee..16d7ed3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+jstest-gtk (0.1.1~git20160825-2) UNRELEASED; urgency=medium
+
+  * Hard-code the data directory instead of relying on binreloc
+    (closes: #850022, #850569).
+
+ -- Stephen Kitt <skitt at debian.org>  Tue, 10 Jan 2017 08:55:59 +0100
+
 jstest-gtk (0.1.1~git20160825-1) unstable; urgency=medium
 
   * New upstream snapshot, switching to CMake.
diff --git a/debian/patches/datadir.patch b/debian/patches/datadir.patch
new file mode 100644
index 0000000..460b8c1
--- /dev/null
+++ b/debian/patches/datadir.patch
@@ -0,0 +1,37 @@
+Description: Hard-code the data directory
+Author: Stephen Kitt <skitt at debian.org>
+
+binreloc fails to find /usr/share/jstest-gtk in some circumstances.
+Since we know where the data directory is, hard-code it.
+
+--- a/src/main.cpp
++++ b/src/main.cpp
+@@ -188,27 +188,7 @@
+ 

+ std::string find_datadir()
+ {
+-  BrInitError error;
+-  if (!br_init(&error))
+-  {
+-    std::ostringstream out;
+-    out << "Error: Couldn't init binreloc: " << error;
+-    throw std::runtime_error(out.str());
+-  }
+-  else
+-  {
+-    char* c_prefix = br_find_exe_dir(NULL);
+-    if (!c_prefix)
+-    {
+-      throw std::runtime_error("Error: Couldn't find prefix");
+-    }
+-    else
+-    {
+-      std::string prefix = c_prefix;
+-      free(c_prefix);
+-      return prefix + "/data/";
+-    }
+-  }
++  return "/usr/share/jstest-gtk/data/";
+ }
+ 

+ int main(int argc, char** argv)
diff --git a/debian/patches/series b/debian/patches/series
index 96879a1..ed671f2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 persistent-settings.patch
+datadir.patch

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



More information about the Pkg-games-commits mailing list