summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Infra
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-05-30 15:45:45 +0000
committerhallgren <hallgren@chalmers.se>2012-05-30 15:45:45 +0000
commit13cda24924614b00e26ae11e109f147c616638e1 (patch)
tree5a12773047eb2e881dc23bb860923795e9a45402 /src/compiler/GF/Infra
parent7196bc86692d2099cfaee71d15a3f3c180cb3b76 (diff)
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).
Diffstat (limited to 'src/compiler/GF/Infra')
-rw-r--r--src/compiler/GF/Infra/BuildInfo.hs18
1 files changed, 17 insertions, 1 deletions
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)