avoid build warnings when building w/o concurrent-output
This commit is contained in:
parent
867fd50637
commit
03b031554f
2 changed files with 9 additions and 3 deletions
|
@ -32,10 +32,12 @@ import GHC.IO.Encoding
|
||||||
- instead.
|
- instead.
|
||||||
-}
|
-}
|
||||||
concurrentMessage :: OutputType -> Bool -> String -> Annex () -> Annex ()
|
concurrentMessage :: OutputType -> Bool -> String -> Annex () -> Annex ()
|
||||||
concurrentMessage o iserror msg fallback
|
|
||||||
#ifdef WITH_CONCURRENTOUTPUT
|
#ifdef WITH_CONCURRENTOUTPUT
|
||||||
|
concurrentMessage o iserror msg fallback
|
||||||
| concurrentOutputEnabled o =
|
| concurrentOutputEnabled o =
|
||||||
go =<< consoleRegion <$> Annex.getState Annex.output
|
go =<< consoleRegion <$> Annex.getState Annex.output
|
||||||
|
#else
|
||||||
|
concurrentMessage _o _iserror _msg fallback
|
||||||
#endif
|
#endif
|
||||||
| otherwise = fallback
|
| otherwise = fallback
|
||||||
#ifdef WITH_CONCURRENTOUTPUT
|
#ifdef WITH_CONCURRENTOUTPUT
|
||||||
|
@ -67,8 +69,8 @@ concurrentMessage o iserror msg fallback
|
||||||
- complete.
|
- complete.
|
||||||
-}
|
-}
|
||||||
inOwnConsoleRegion :: OutputType -> Annex a -> Annex a
|
inOwnConsoleRegion :: OutputType -> Annex a -> Annex a
|
||||||
inOwnConsoleRegion o a
|
|
||||||
#ifdef WITH_CONCURRENTOUTPUT
|
#ifdef WITH_CONCURRENTOUTPUT
|
||||||
|
inOwnConsoleRegion o a
|
||||||
| concurrentOutputEnabled o = do
|
| concurrentOutputEnabled o = do
|
||||||
r <- mkregion
|
r <- mkregion
|
||||||
setregion (Just r)
|
setregion (Just r)
|
||||||
|
@ -82,6 +84,8 @@ inOwnConsoleRegion o a
|
||||||
Right ret -> do
|
Right ret -> do
|
||||||
rmregion r
|
rmregion r
|
||||||
return ret
|
return ret
|
||||||
|
#else
|
||||||
|
inOwnConsoleRegion _o a
|
||||||
#endif
|
#endif
|
||||||
| otherwise = a
|
| otherwise = a
|
||||||
#ifdef WITH_CONCURRENTOUTPUT
|
#ifdef WITH_CONCURRENTOUTPUT
|
||||||
|
|
|
@ -45,8 +45,8 @@ metered combinemeterupdate key a = case keySize key of
|
||||||
maybe noop (\m -> m n) combinemeterupdate
|
maybe noop (\m -> m n) combinemeterupdate
|
||||||
liftIO $ clearMeter stdout meter
|
liftIO $ clearMeter stdout meter
|
||||||
return r
|
return r
|
||||||
go size o@(ConcurrentOutput {})
|
|
||||||
#if WITH_CONCURRENTOUTPUT
|
#if WITH_CONCURRENTOUTPUT
|
||||||
|
go size o@(ConcurrentOutput {})
|
||||||
| concurrentOutputEnabled o = withProgressRegion $ \r -> do
|
| concurrentOutputEnabled o = withProgressRegion $ \r -> do
|
||||||
(progress, meter) <- mkmeter size
|
(progress, meter) <- mkmeter size
|
||||||
a $ \n -> liftIO $ do
|
a $ \n -> liftIO $ do
|
||||||
|
@ -54,6 +54,8 @@ metered combinemeterupdate key a = case keySize key of
|
||||||
s <- renderMeter meter
|
s <- renderMeter meter
|
||||||
Regions.setConsoleRegion r ("\n" ++ s)
|
Regions.setConsoleRegion r ("\n" ++ s)
|
||||||
maybe noop (\m -> m n) combinemeterupdate
|
maybe noop (\m -> m n) combinemeterupdate
|
||||||
|
#else
|
||||||
|
go _size _o
|
||||||
#endif
|
#endif
|
||||||
| otherwise = nometer
|
| otherwise = nometer
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue