From 4f9af46ed0f8a5d3bffdbbddc5ca00b5104bf027 Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 11 Sep 2014 11:47:17 +0000 Subject: [PATCH] Setup.hs: don't ask darcs for the version history if _darcs is not present This is to avoid a (harmless) error message from darcs when compiling sources obtained e.g. from github. --- Setup.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Setup.hs b/Setup.hs index 066b86319..8a426d1dd 100644 --- a/Setup.hs +++ b/Setup.hs @@ -383,7 +383,8 @@ extractDarcsVersion distFlag = modname = "DarcsVersion_gf" askDarcs = - do tags <- lines `fmap` readProcess "darcs" ["show","tags"] "" + do flip unless (fail "no _darcs") =<< doesDirectoryExist "_darcs" + tags <- lines `fmap` readProcess "darcs" ["show","tags"] "" let from = case tags of [] -> [] tag:_ -> ["--from-tag="++tag]