Author: sveinung
Date: Wed Aug  5 12:59:31 2015
New Revision: 29335

URL: http://svn.gna.org/viewcvs/freeciv?rev=29335&view=rev
Log:
Development version internal savegame compatibility

The save game format usually changes many times during the development of a
new version of Freeciv. Permanently carrying support for loading every
development version save game format isn't sustainable. The support for
loading save games from previously released versions is enough.

At the same time it would be nice to be able to load that game started with
last week's development version. Not having your save games broken on every
upgrade would help motivate testers. It would also make Freeciv-web's life
easier.

I think a reasonable compromise is to have clearly marked development
version internal save game compatibility code. The compatibility code should
always be removed before a release to take care of the sustainability issue.
It may also be removed during a development version if the backwards
compatibility becomes a large burden.

The marking should be machine readable to make it easy to remove all
development version internal save game compatibility code sections at once.
It should also be possible to build a development version without any
compatibility code so save game loading error handling code can be tested.

Add the new configure option --enable-dev-save-compat. If enabled the new
symbol FREECIV_DEV_SAVE_COMPAT is defined. Development version save game
compatibility code sections can then be marked using regular macros.

See patch #6154

Modified:
    trunk/configure.ac

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=29335&r1=29334&r2=29335&view=diff
==============================================================================
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Wed Aug  5 12:59:31 2015
@@ -228,6 +228,20 @@
   AS_HELP_STRING([--with-appdatadir], [install appdata files to given dir]),
 [ APPDATADIR=${withval} ], [ APPDATADIR="\$(prefix)/share/appdata" ])
 AC_SUBST([APPDATADIR])
+
+dnl try to support this development version's previous save games formats
+AC_ARG_ENABLE([dev-save-compat],
+  AS_HELP_STRING([--enable-dev-save-compat=yes/no],
+                 [enable development version save game compatibility]),
+  [case "${enableval}" in
+    yes) dev_save_compat=1 ;;
+    no) dev_save_compat=0 ;;
+    *) AC_MSG_ERROR([bad value ${enableval} for --enable-dev-save-compat]) ;;
+  esac],
+  [dev_save_compat=$IS_DEVEL_VERSION])
+AS_IF([test $dev_save_compat != 0],
+      [AC_DEFINE([FREECIV_DEV_SAVE_COMPAT], [1],
+                 [Development version save game compatibility])])
 
 dnl set default values
 mapimg_all=auto


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

Reply via email to