From b9b02171601f68a8896ad2f369c700e356c8615b Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 4 Jul 2018 13:40:46 +0200 Subject: [PATCH] Remove code which tries to get version information from darcs folder --- Setup.hs | 30 ------------------------------ gf.cabal | 5 ----- src/compiler/GF/Infra/BuildInfo.hs | 16 ---------------- 3 files changed, 51 deletions(-) diff --git a/Setup.hs b/Setup.hs index 169047bcb..9749d27fe 100644 --- a/Setup.hs +++ b/Setup.hs @@ -37,7 +37,6 @@ main = defaultMainWithHooks simpleUserHooks{ preBuild = gfPreBuild gfPre args distFlag = do h <- checkRGLArgs args - extractDarcsVersion distFlag return h gfPostBuild args flags pkg lbi = @@ -383,35 +382,6 @@ default_gf lbi = buildDir lbi exeName' exeNameReal exeNameReal = exeName' <.> (if null $ takeExtension exeName' then exeExtension else "") -} --- | Create autogen module with detailed version info by querying darcs -extractDarcsVersion distFlag = - do info <- tryIOE askDarcs - createDirectoryIfMissing True autogenPath - updateFile versionModulePath $ unlines $ - ["module "++modname++" where", - "{-# NOINLINE darcs_info #-}", - "darcs_info = "++show (either (const (Left ())) Right info)] - where - dist = fromFlagOrDefault "dist" distFlag - autogenPath = dist"build""autogen" - versionModulePath = autogenPath"DarcsVersion_gf.hs" - modname = "DarcsVersion_gf" - -askDarcs = - do flip unless (fail "no _darcs") =<< doesDirectoryExist "_darcs" - tags <- lines `fmap` readProcess "darcs" ["show","tags"] "" - let from = case tags of - [] -> [] - tag:_ -> ["--from-tag="++tag] - dates <- (init' . patches) `fmap` readProcess "darcs" ("changes":from) "" --- let dates = init' (filter ((`notElem` [""," "]).take 1) changes) - whatsnew <- tryIOE $ lines `fmap` readProcess "darcs" ["whatsnew","-s"] "" - return (listToMaybe tags,listToMaybe dates, - length dates,either (const 0) length whatsnew) - where - init' [] = [] - init' xs = init xs - -- | Only update the file if contents has changed updateFile path new = do old <- tryIOE $ readFile path diff --git a/gf.cabal b/gf.cabal index 54661ea13..5c795c10a 100644 --- a/gf.cabal +++ b/gf.cabal @@ -39,10 +39,6 @@ data-files: www/translator/*.css www/translator/*.js ---source-repository head --- type: darcs --- location: http://www.grammaticalframework.org/ - source-repository head type: git location: https://github.com/GrammaticalFramework/GF.git @@ -162,7 +158,6 @@ Library GF.Data.Operations GF.Infra.Option GF.Infra.UseIO - DarcsVersion_gf GF.Command.Abstract GF.Command.CommandInfo GF.Command.Commands diff --git a/src/compiler/GF/Infra/BuildInfo.hs b/src/compiler/GF/Infra/BuildInfo.hs index 9cf111831..f0230246b 100644 --- a/src/compiler/GF/Infra/BuildInfo.hs +++ b/src/compiler/GF/Infra/BuildInfo.hs @@ -2,11 +2,9 @@ module GF.Infra.BuildInfo where import System.Info import Data.Version(showVersion) -import DarcsVersion_gf {-# NOINLINE buildInfo #-} buildInfo = - {-details++"\n"++-} "Built on "++os++"/"++arch ++" with "++compilerName++"-"++showVersion compilerVersion ++", flags:" @@ -22,17 +20,3 @@ buildInfo = #ifdef C_RUNTIME ++" c-runtime" #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)