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).
This commit is contained in:
hallgren
2012-05-30 15:45:45 +00:00
parent 7196bc8669
commit 13cda24924
2 changed files with 60 additions and 5 deletions

View File

@@ -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)