diff options
| author | hallgren <hallgren@chalmers.se> | 2015-10-02 11:46:29 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2015-10-02 11:46:29 +0000 |
| commit | 5c933bd4cf768701b8c68779657ece1a648b3f17 (patch) | |
| tree | 90c0951bf878478bc4635657d07ae452c194b5ce /Setup.hs | |
| parent | 1b2dfbb6d8a905bcd3336a4b4a5d2b5e3569782d (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.hs | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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 |
