mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
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:
24
Setup.hs
24
Setup.hs
@@ -392,18 +392,18 @@ extractDarcsVersion distFlag =
|
|||||||
versionModulePath = autogenPath</>"DarcsVersion_gf.hs"
|
versionModulePath = autogenPath</>"DarcsVersion_gf.hs"
|
||||||
modname = "DarcsVersion_gf"
|
modname = "DarcsVersion_gf"
|
||||||
|
|
||||||
askDarcs =
|
askDarcs =
|
||||||
do flip unless (fail "no _darcs") =<< doesDirectoryExist "_darcs"
|
do flip unless (fail "no _darcs") =<< doesDirectoryExist "_darcs"
|
||||||
tags <- lines `fmap` readProcess "darcs" ["show","tags"] ""
|
tags <- lines `fmap` readProcess "darcs" ["show","tags"] ""
|
||||||
let from = case tags of
|
let from = case tags of
|
||||||
[] -> []
|
[] -> []
|
||||||
tag:_ -> ["--from-tag="++tag]
|
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)
|
-- let dates = init' (filter ((`notElem` [""," "]).take 1) changes)
|
||||||
whatsnew <- tryIOE $ lines `fmap` readProcess "darcs" ["whatsnew","-s"] ""
|
whatsnew <- tryIOE $ lines `fmap` readProcess "darcs" ["whatsnew","-s"] ""
|
||||||
return (listToMaybe tags,listToMaybe dates,
|
return (listToMaybe tags,listToMaybe dates,
|
||||||
length dates,either (const 0) length whatsnew)
|
length dates,either (const 0) length whatsnew)
|
||||||
|
where
|
||||||
init' [] = []
|
init' [] = []
|
||||||
init' xs = init xs
|
init' xs = init xs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user