1
0
forked from GitHub/gf-core

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.
This commit is contained in:
hallgren
2015-10-02 11:46:29 +00:00
parent 74d8e9c6cf
commit 5469706080

View File

@@ -398,12 +398,12 @@ extractDarcsVersion distFlag =
let from = case tags of
[] -> []
tag:_ -> ["--from-tag="++tag]
dates <- patches `fmap` readProcess "darcs" ("changes":from) ""
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