Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#9852) Save games & logs go to wrong directory
Home

[Freeciv-Dev] Re: (PR#9852) Save games & logs go to wrong directory

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9852) Save games & logs go to wrong directory
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sun, 12 Sep 2004 10:35:12 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9852 >

Marko Lindqvist wrote:
>   I think that best thing to do would be going back to setting 
> FREECIV_PATH. To avoid #8677 problems we should check if it's previously 
> unset and if so, provide default paths ( '.' and '~/.freeciv') in it 
> too. Ugly and hackish solution, yes, but only one I see capable of 
> solving all related problems.

  This patch reverts changes made in #8677 and #8802 and fixes #8677 
problems by above method.

  Even older changes to these scripts, and related discussion, are at #8635.


  - Caz


diff -Nurd -X.diff_ignore freeciv/civ.in freeciv/civ.in
--- freeciv/civ.in      2004-09-12 13:23:13.968750000 +0300
+++ freeciv/civ.in      2004-09-12 19:56:41.640625000 +0300
@@ -14,13 +14,16 @@
 #
 #***********************************************************************/
 
-# Find absolute paths for srcdir and builddir.
 BUILDDIR=`dirname $0`
 
-# make absolute
-BUILDDIR=`cd $BUILDDIR;pwd`
+# Use cd + pwd instead of manual concatentation in case of absolute paths
+BUILDDATA=$(cd $BUILDDIR/data ; pwd)
+SRCDATA=$(cd $BUILDDIR ; cd @top_srcdir@/data ; pwd)
 
-SRCDIR="$BUILDDIR/@top_srcdir@"
+if [ "x$FREECIV_PATH" = "x" ] ; then
+  FREECIV_PATH=".:data:~/.freeciv"
+fi
+export FREECIV_PATH="$FREECIV_PATH:$BUILDDATA:$SRCDATA"
 
 [ -x $BUILDDIR/client/civclient ] && EXE=$BUILDDIR/client/civclient
 [ -x $BUILDDIR/civclient ] && EXE=$BUILDDIR/civclient
@@ -30,4 +33,4 @@
   exit 1
 fi
 
-cd $SRCDIR && exec $EXE ${1+"$@"}
+exec $EXE ${1+"$@"}
diff -Nurd -X.diff_ignore freeciv/ser.in freeciv/ser.in
--- freeciv/ser.in      2004-09-12 13:23:42.375000000 +0300
+++ freeciv/ser.in      2004-09-12 19:56:33.156250000 +0300
@@ -14,13 +14,16 @@
 #
 #***********************************************************************/
 
-# Find absolute paths for srcdir and builddir.
 BUILDDIR=`dirname $0`
 
-# make absolute
-BUILDDIR=`cd $BUILDDIR;pwd`
+# Use cd + pwd instead of manual concatentation in case of absolute paths
+BUILDDATA=$(cd $BUILDDIR/data ; pwd)
+SRCDATA=$(cd $BUILDDIR ; cd @top_srcdir@/data ; pwd)
 
-SRCDIR="$BUILDDIR/@top_srcdir@"
+if [ "x$FREECIV_PATH" = "x" ] ; then
+  FREECIV_PATH=".:data:~/.freeciv"
+fi
+export FREECIV_PATH="$FREECIV_PATH:$BUILDDATA:$SRCDATA"
 
 [ -x $BUILDDIR/server/civserver ] && EXE=$BUILDDIR/server/civserver
 [ -x $BUILDDIR/civserver ] && EXE=$BUILDDIR/civserver
@@ -30,4 +33,4 @@
   exit 1
 fi
 
-cd $SRCDIR && exec $EXE ${1+"$@"}
+exec $EXE ${1+"$@"}

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9852) Save games & logs go to wrong directory, Marko Lindqvist <=