From 13cda24924614b00e26ae11e109f147c616638e1 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 30 May 2012 15:45:45 +0000 Subject: More detailed version info in the startup message The Setup.hs script now queries darcs to create more detailed version info to include in the startup message. Note thought that with distributed version control systems like darcs, the only way to uniquely identify a version is by the set of patches included. Since the patches are not totally ordered, just looking at the last patch is not enough. For official releases, we tag the current set of patches so we can refer to it by name (e.g. RELEASE-3.3.3). --- src/compiler/GF/Infra/BuildInfo.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/compiler/GF/Infra/BuildInfo.hs b/src/compiler/GF/Infra/BuildInfo.hs index 2ff770393..a9c974e74 100644 --- a/src/compiler/GF/Infra/BuildInfo.hs +++ b/src/compiler/GF/Infra/BuildInfo.hs @@ -2,9 +2,11 @@ module GF.Infra.BuildInfo where import System.Info import Data.Version(showVersion) +import DarcsVersion_gf buildInfo = - "Built on "++os++"/"++arch + details + ++"\nBuilt on "++os++"/"++arch ++" with "++compilerName++"-"++showVersion compilerVersion ++", flags:" #ifdef USE_INTERRUPT @@ -13,3 +15,17 @@ buildInfo = #ifdef SERVER_MODE ++" server" #endif + where + details = either (const no_info) info darcs_info + no_info = "No detailed version info available" + info (otag,olast,changes,whatsnew) = + (case changes of + 0 -> "No recorded changes" + 1 -> "One recorded change" + _ -> show changes++" recorded changes")++ + (case whatsnew of + 0 -> "" + 1 -> " + one file with unrecorded changes" + _ -> " + "++show whatsnew++" files with unrecorded changes")++ + (maybe "" (" since "++) otag)++ + (maybe "" ("\nLast recorded change: "++) olast) -- cgit v1.2.3