The following commit has been merged in the master branch:
commit c9bdf9d57a41251a8089e44a72a584f3d09184f8
Author: Felix Geyer <[email protected]>
Date:   Fri Dec 2 15:53:33 2011 +0100

    Update 05_server_search_path.patch.

diff --git a/debian/patches/05_server_search_path.patch 
b/debian/patches/05_server_search_path.patch
index 19d99fd..1936267 100644
--- a/debian/patches/05_server_search_path.patch
+++ b/debian/patches/05_server_search_path.patch
@@ -15,11 +15,57 @@ Bug-Debian: http://bugs.debian.org/648204
  #include "DedicatedServer.h"
  #include "InputSource.h"
  #include "PhysicWorld.h"
-@@ -497,6 +499,7 @@ void setup_physfs(char* argv0)
+@@ -107,6 +109,8 @@ int main(int argc, char** argv)
+       Color firstPlayerColor;
+ 
+       config.loadFile("server.xml");
++      // make sure the config is present in the user dir
++      config.saveFile("server.xml");
+ 
+       int port = config.getInteger("port");
+       float speed = config.getFloat("speed");
+@@ -493,6 +497,29 @@ void wait_and_restart_child()
+ 
+ }
+ 
++// copied from main.cpp, should be moved to a common place
++void probeDir(const std::string& dirname)
++{
++      if (PHYSFS_isDirectory(dirname.c_str()) == 0)
++      {
++              if (PHYSFS_exists(dirname.c_str()))
++              {
++                      PHYSFS_delete(dirname.c_str());
++              }
++              if (PHYSFS_mkdir(dirname.c_str()))
++              {
++                      std::cout << PHYSFS_getWriteDir() <<
++                              dirname << " created" << std::endl;
++              }
++              else
++              {
++                      std::cout << "Warning: Creation of" << 
++                              PHYSFS_getWriteDir() << dirname <<
++                              " failed!" << std::endl;
++              }
++      }
++}
++
+ void setup_physfs(char* argv0)
  {
        PHYSFS_init(argv0);
-       PHYSFS_addToSearchPath("data", 1);
-+      PHYSFS_addToSearchPath(BLOBBY_INSTALL_PREFIX  "/share/blobby", 1);
-       
-       #if defined(WIN32)
+@@ -502,9 +529,14 @@ void setup_physfs(char* argv0)
        // Just write in installation directory
+       PHYSFS_setWriteDir("data");
+       #else
++      PHYSFS_addToSearchPath(BLOBBY_INSTALL_PREFIX  "/share/blobby", 1);
+       std::string userdir = PHYSFS_getUserDir();
+       std::string userAppend = ".blobby";
+       std::string homedir = userdir + userAppend;
++      PHYSFS_addToSearchPath(userdir.c_str(), 0);
++      PHYSFS_setWriteDir(userdir.c_str());
++      probeDir(userAppend);
++      PHYSFS_removeFromSearchPath(userdir.c_str());
+       PHYSFS_addToSearchPath(homedir.c_str(), 0);
+       PHYSFS_setWriteDir(homedir.c_str());
+       #endif

-- 
blobby Debian packaging

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to