mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-18 17:29:32 -06:00
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).
32 lines
913 B
Haskell
32 lines
913 B
Haskell
{-# LANGUAGE CPP #-}
|
|
module GF.Infra.BuildInfo where
|
|
import System.Info
|
|
import Data.Version(showVersion)
|
|
import DarcsVersion_gf
|
|
|
|
buildInfo =
|
|
details
|
|
++"\nBuilt on "++os++"/"++arch
|
|
++" with "++compilerName++"-"++showVersion compilerVersion
|
|
++", flags:"
|
|
#ifdef USE_INTERRUPT
|
|
++" interrupt"
|
|
#endif
|
|
#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)
|