print a warning message when garbage is received from configlist
This commit is contained in:
parent
9769235d6b
commit
ff6ce2bc15
2 changed files with 16 additions and 2 deletions
|
@ -23,6 +23,7 @@ module Messages (
|
||||||
showEndResult,
|
showEndResult,
|
||||||
showErr,
|
showErr,
|
||||||
warning,
|
warning,
|
||||||
|
warningIO,
|
||||||
fileNotFound,
|
fileNotFound,
|
||||||
indent,
|
indent,
|
||||||
maybeShowJSON,
|
maybeShowJSON,
|
||||||
|
@ -158,6 +159,12 @@ warning' w = do
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
hPutStrLn stderr w
|
hPutStrLn stderr w
|
||||||
|
|
||||||
|
warningIO :: String -> IO ()
|
||||||
|
warningIO w = do
|
||||||
|
putStr "\n"
|
||||||
|
hFlush stdout
|
||||||
|
hPutStrLn stderr w
|
||||||
|
|
||||||
{- Displays a warning one time about a file the user specified not existing. -}
|
{- Displays a warning one time about a file the user specified not existing. -}
|
||||||
fileNotFound :: FilePath -> Annex ()
|
fileNotFound :: FilePath -> Annex ()
|
||||||
fileNotFound file = do
|
fileNotFound file = do
|
||||||
|
|
|
@ -161,8 +161,15 @@ tryGitConfigRead r
|
||||||
=<< liftIO (try a :: IO (Either SomeException Git.Repo))
|
=<< liftIO (try a :: IO (Either SomeException Git.Repo))
|
||||||
|
|
||||||
pipedconfig cmd params =
|
pipedconfig cmd params =
|
||||||
withHandle StdoutHandle createProcessSuccess p $
|
withHandle StdoutHandle createProcessSuccess p $ \h -> do
|
||||||
Git.Config.hRead r
|
fileEncoding h
|
||||||
|
val <- hGetContentsStrict h
|
||||||
|
r' <- Git.Config.store val r
|
||||||
|
when (getUncachedUUID r' == NoUUID && not (null val)) $ do
|
||||||
|
warningIO $ "Failed to get annex.uuid configuration of repository " ++ Git.repoDescribe r
|
||||||
|
warningIO $ "Instead, got: " ++ show val
|
||||||
|
warningIO $ "This is unexpected; please check the network transport!"
|
||||||
|
return r'
|
||||||
where
|
where
|
||||||
p = proc cmd $ toCommand params
|
p = proc cmd $ toCommand params
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue