summaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-05-30 16:15:59 +0000
committerhallgren <hallgren@chalmers.se>2012-05-30 16:15:59 +0000
commit22e1a5b9f7e4e7dc9ca39be44a3b4b87d5f0cde4 (patch)
treecbb038cdbe847b28289a6ded040b1a9d21c5b154 /Setup.hs
parent13cda24924614b00e26ae11e109f147c616638e1 (diff)
Setup.hs: fix two problems with querying darcs
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Setup.hs b/Setup.hs
index 3b6462e9d..c0eee9101 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -376,7 +376,7 @@ extractDarcsVersion distFlag =
do info <- E.try askDarcs
updateFile versionModulePath $ unlines $
["module "++modname++" where",
- "darcs_info = "++show info]
+ "darcs_info = "++show (either (const (Left ())) Right info)]
where
dist = fromFlagOrDefault "dist" distFlag
versionModulePath = dist</>"build"</>"autogen"</>"DarcsVersion_gf.hs"
@@ -389,9 +389,9 @@ extractDarcsVersion distFlag =
tag:_ -> ["--from-tag="++tag]
changes <- lines `fmap` readProcess "darcs" ("changes":from) ""
let dates = filter ((`notElem` [""," "]).take 1) changes
- whatsnew <- lines `fmap` readProcess "darcs" ["whatsnew","-s"] ""
+ whatsnew<-E.try $ lines `fmap` readProcess "darcs" ["whatsnew","-s"] ""
return (listToMaybe tags,listToMaybe dates,
- length dates,length whatsnew)
+ length dates,either (const 0) length whatsnew)
-- | Only update the file if contents has changed
updateFile path new =