summaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-10-02 11:46:29 +0000
committerhallgren <hallgren@chalmers.se>2015-10-02 11:46:29 +0000
commit5c933bd4cf768701b8c68779657ece1a648b3f17 (patch)
tree90c0951bf878478bc4635657d07ae452c194b5ce /Setup.hs
parent1b2dfbb6d8a905bcd3336a4b4a5d2b5e3569782d (diff)
Setup.hs: fix off-by-one error the change count in the version info
The difference between "One change" and "No changes" is very noticeable.
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/Setup.hs b/Setup.hs
index 71bf797e2..fea8a6938 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -392,18 +392,18 @@ extractDarcsVersion distFlag =
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 <- 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)
-
+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