imp: ghc9.2: fix an incomplete-uni-pattern warning

This commit is contained in:
Simon Michael 2022-03-25 20:45:06 -10:00
parent 3eddd913e3
commit 5858bb7b6d

View File

@ -65,15 +65,15 @@ versionStringWith egitinfo progname packageversion =
| otherwise = os
version = case egitinfo of
Left _err -> packageversion
Right gitinfo -> intercalate "-" [packageversion , hash, date]
Right gitinfo ->
case words $ giCommitDate gitinfo of
-- git log's date format is normally --date=default ("similar to --date=rfc2822")
_weekday:mon:day:_localtime:year:_offset:_ ->
intercalate "-" [packageversion , hash, date]
where
hash = 'g' : take 9 (giHash gitinfo) -- like git describe
date = concat [year,mm,dd]
where
-- XXX PARTIAL: depends on git log's date format, which by default
-- is --date=default ("similar to --date=rfc2822"), but could be
-- overridden by a log.date config variable in repo or user git config.
_weekday:mon:day:_localtime:year:_offset:_ = words $ giCommitDate gitinfo
mm = fromMaybe mon $ lookup mon $ [
("Jan","01")
,("Feb","02")
@ -89,6 +89,8 @@ versionStringWith egitinfo progname packageversion =
,("Dec","12")
]
dd = (if length day < 2 then ('0':) else id) day
-- but could be overridden by a log.date config variable in repo or user git config
_ -> packageversion
-- -- | Given a program name, return a precise platform-specific executable
-- -- name suitable for naming downloadable binaries. Can raise an error if