Author: cazfi
Date: Wed Aug 26 05:30:56 2015
New Revision: 29679

URL: http://svn.gna.org/viewcvs/freeciv?rev=29679&view=rev
Log:
Deprecated FREECIV_PATH usage

See patch #6279

Modified:
    branches/S2_6/bootstrap/fcgui.in
    branches/S2_6/bootstrap/fcruledit.in
    branches/S2_6/bootstrap/fcser.in
    branches/S2_6/utility/shared.c

Modified: branches/S2_6/bootstrap/fcgui.in
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/bootstrap/fcgui.in?rev=29679&r1=29678&r2=29679&view=diff
==============================================================================
--- branches/S2_6/bootstrap/fcgui.in    (original)
+++ branches/S2_6/bootstrap/fcgui.in    Wed Aug 26 05:30:56 2015
@@ -54,17 +54,12 @@
   if test "x$FREECIV_PATH" = "x" ; then
     
FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@~/.freeciv/@DATASUBDIR@"
   else
+    echo "$0: FREECIV_PATH is deprecated"
     FREECIV_DATA_PATH="${FREECIV_PATH}"
   fi
 fi
 
FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@/data@HOST_PATH_SEPARATOR@@abs_top_srcdir@/data"
 export FREECIV_DATA_PATH
-
-if test "x$FREECIV_PATH" = "x" ; then
-  
FREECIV_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@~/.freeciv@HOST_PATH_SEPARATOR@~/.freeciv/@DATASUBDIR@"
-fi
-FREECIV_PATH="${FREECIV_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@"
-export FREECIV_PATH
 
 if test "x$FREECIV_SAVE_PATH" = "x" ; then
   FREECIV_SAVE_PATH=".@HOST_PATH_SEPARATOR@~/.freeciv/saves"

Modified: branches/S2_6/bootstrap/fcruledit.in
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/bootstrap/fcruledit.in?rev=29679&r1=29678&r2=29679&view=diff
==============================================================================
--- branches/S2_6/bootstrap/fcruledit.in        (original)
+++ branches/S2_6/bootstrap/fcruledit.in        Wed Aug 26 05:30:56 2015
@@ -31,17 +31,12 @@
   if test "x$FREECIV_PATH" = "x" ; then
     
FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@~/.freeciv/@DATASUBDIR@"
   else
+    echo "$0: FREECIV_PATH is deprecated"  
     FREECIV_DATA_PATH="${FREECIV_PATH}"
   fi
 fi
 
FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@/data@HOST_PATH_SEPARATOR@@abs_top_srcdir@/data"
 export FREECIV_DATA_PATH
 
-if test "x$FREECIV_PATH" = "x" ; then
-  
FREECIV_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@~/.freeciv@HOST_PATH_SEPARATOR@~/.freeciv/@DATASUBDIR@"
-fi
-FREECIV_PATH="${FREECIV_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@"
-export FREECIV_PATH
-
 echo "Running $EXE"
 exec "$EXE" ${1+"$@"}

Modified: branches/S2_6/bootstrap/fcser.in
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/bootstrap/fcser.in?rev=29679&r1=29678&r2=29679&view=diff
==============================================================================
--- branches/S2_6/bootstrap/fcser.in    (original)
+++ branches/S2_6/bootstrap/fcser.in    Wed Aug 26 05:30:56 2015
@@ -21,17 +21,12 @@
   if test "x$FREECIV_PATH" = "x" ; then
     
FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@~/.freeciv/@DATASUBDIR@"
   else
+    echo "$0: FREECIV_PATH is deprecated"
     FREECIV_DATA_PATH="${FREECIV_PATH}"
   fi
 fi
 
FREECIV_DATA_PATH="${FREECIV_DATA_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@/data@HOST_PATH_SEPARATOR@@abs_top_srcdir@/data"
 export FREECIV_DATA_PATH
-
-if test "x$FREECIV_PATH" = "x" ; then
-  
FREECIV_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@~/.freeciv@HOST_PATH_SEPARATOR@~/.freeciv/@DATASUBDIR@"
-fi
-FREECIV_PATH="${FREECIV_PATH}@HOST_PATH_SEPARATOR@@abs_top_builddir@"
-export FREECIV_PATH
 
 if test "x$FREECIV_SAVE_PATH" = "x" ; then
   FREECIV_SAVE_PATH=".@HOST_PATH_SEPARATOR@~/.freeciv/saves"

Modified: branches/S2_6/utility/shared.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/utility/shared.c?rev=29679&r1=29678&r2=29679&view=diff
==============================================================================
--- branches/S2_6/utility/shared.c      (original)
+++ branches/S2_6/utility/shared.c      Wed Aug 26 05:30:56 2015
@@ -119,6 +119,8 @@
 static char *mc_group = NULL;
 static char *home_dir = NULL;
 
+static bool depr_freeciv_path_warned = FALSE;
+
 static struct astring realfile = ASTRING_INIT;
 
 static int compare_file_mtime_ptrs(const struct fileinfo *const *ppa,
@@ -995,12 +997,18 @@
                 FREECIV_DATA_PATH, FREECIV_PATH);
       path = NULL;
     }
-    if (NULL == path && (path = getenv(FREECIV_PATH)) && '\0' == path[0]) {
-      /* TRANS: <FREECIV_PATH> configuration error */
-      log_error(_("\"%s\" is set but empty; using default \"%s\" "
-                 "data directories instead."),
-                FREECIV_PATH, DEFAULT_DATA_PATH);
-      path = NULL;
+    if (NULL == path && (path = getenv(FREECIV_PATH))) {
+      if (!depr_freeciv_path_warned) {
+        log_error(_("FREECIV_PATH is deprecated, and won't work in future 
versions."));
+        depr_freeciv_path_warned = TRUE;
+      }
+      if ('\0' == path[0]) {
+        /* TRANS: <FREECIV_PATH> configuration error */
+        log_error(_("\"%s\" is set but empty; using default \"%s\" "
+                    "data directories instead."),
+                  FREECIV_PATH, DEFAULT_DATA_PATH);
+        path = NULL;
+      }
     }
     data_dir_names = base_get_dirs(NULL != path ? path : DEFAULT_DATA_PATH);
     strvec_remove_duplicate(data_dir_names, strcmp); /* Don't set a path both. 
*/
@@ -1040,6 +1048,10 @@
       path = NULL;
     }
     if (NULL == path && (path = getenv(FREECIV_PATH))) {
+      if (!depr_freeciv_path_warned) {
+        log_error(_("FREECIV_PATH is deprecated, and won't work in future 
versions."));
+        depr_freeciv_path_warned = TRUE;
+      }
       if ('\0' == path[0]) {
         /* TRANS: <FREECIV_PATH> configuration error */
         log_error(_("\"%s\" is set but empty; using default \"%s\" "
@@ -1099,6 +1111,10 @@
       path = NULL;
     }
     if (NULL == path && (path = getenv(FREECIV_PATH))) {
+      if (!depr_freeciv_path_warned) {
+        log_error(_("FREECIV_PATH is deprecated, and won't work in future 
versions."));
+        depr_freeciv_path_warned = TRUE;
+      }
       if ('\0' == path[0]) {
         /* TRANS: <FREECIV_PATH> configuration error */
         log_error( _("\"%s\" is set but empty; using default \"%s\" "


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to