imp: setup: show full --version output
This commit is contained in:
parent
c3c91448a7
commit
f0ff2aa34e
@ -147,13 +147,16 @@ setupHledger = do
|
|||||||
ok = if exit == ExitSuccess then Y else N
|
ok = if exit == ExitSuccess then Y else N
|
||||||
msg = if ok==Y then "" else "'" <> progname <> " " <> arg <> "' failed: \n" <> err
|
msg = if ok==Y then "" else "'" <> progname <> " " <> arg <> "' failed: \n" <> err
|
||||||
p ok msg
|
p ok msg
|
||||||
let verparts = words out -- use below
|
-- save output, used below
|
||||||
|
let
|
||||||
|
versionstr = rstrip out
|
||||||
|
versionstrparts = words versionstr
|
||||||
|
|
||||||
-- If hledger runs, run more checks
|
-- If hledger runs, run more checks
|
||||||
when (ok==Y) $ do
|
when (ok==Y) $ do
|
||||||
pdesc "is a native binary ?"
|
pdesc "is a native binary ?"
|
||||||
let
|
let
|
||||||
exearch = case drop 2 verparts of
|
exearch = case drop 2 versionstrparts of
|
||||||
w:_ -> w
|
w:_ -> w
|
||||||
_ -> error' "couldn't parse arch from --version output"
|
_ -> error' "couldn't parse arch from --version output"
|
||||||
os' -- keep synced: Version.hs
|
os' -- keep synced: Version.hs
|
||||||
@ -162,7 +165,7 @@ setupHledger = do
|
|||||||
| otherwise = os
|
| otherwise = os
|
||||||
sysarch = os' <> "-" <> arch
|
sysarch = os' <> "-" <> arch
|
||||||
(ok, msg)
|
(ok, msg)
|
||||||
| exearch == sysarch = (Y, "")
|
| exearch == sysarch = (Y, versionstr)
|
||||||
| otherwise = (N, "installed binary is for " <> exearch <> ", system is " <> sysarch)
|
| otherwise = (N, "installed binary is for " <> exearch <> ", system is " <> sysarch)
|
||||||
p ok msg
|
p ok msg
|
||||||
|
|
||||||
@ -172,7 +175,7 @@ setupHledger = do
|
|||||||
(ok, msg) = case elatestver of
|
(ok, msg) = case elatestver of
|
||||||
Left e -> (U, "could not read " <> latestHledgerVersionUrlStr <> " : " <> e)
|
Left e -> (U, "could not read " <> latestHledgerVersionUrlStr <> " : " <> e)
|
||||||
Right latestver ->
|
Right latestver ->
|
||||||
case drop 1 verparts of
|
case drop 1 versionstrparts of
|
||||||
[] -> (U, "could not parse --version output")
|
[] -> (U, "could not parse --version output")
|
||||||
w:_ -> (ok, msg)
|
w:_ -> (ok, msg)
|
||||||
where
|
where
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user