ENH don't use putstrln for printing packages

This commit is contained in:
Nathan Dwarshuis 2023-01-01 11:14:58 -05:00
parent f875b7c71d
commit 91ff25a8d2
3 changed files with 8 additions and 7 deletions

View File

@ -66,10 +66,10 @@ evalConfig db = do
printDeps :: FIO ()
printDeps = withDBus_ $ \db ->
mapM_ (liftIO . putStrLn . T.unpack) $
mapM_ logInfo $
fmap showFulfillment $
sort $
nub $
fmap showFulfillment $
concatMap dumpFeature $
allFeatures db

View File

@ -217,7 +217,7 @@ withXmobar = bracket startXmobar cleanup
printDeps :: FIO ()
printDeps = withDBus_ $ \db -> do
(i, f, d) <- allFeatures db
mapM_ (liftIO . putStrLn . T.unpack) $
mapM_ logInfo $
fmap showFulfillment $
sort $
nub $

View File

@ -186,8 +186,9 @@ logMsg (FMsg fn n (Msg ll m)) = do
--------------------------------------------------------------------------------
-- Package status
showFulfillment :: Fulfillment -> T.Text
showFulfillment (Package t n) = T.concat [T.pack $ show t, "\t", n]
showFulfillment :: Fulfillment -> Utf8Builder
showFulfillment (Package t n) =
displayShow t <> "\t" <> Utf8Builder (encodeUtf8Builder n)
dumpFeature :: Feature a -> [Fulfillment]
dumpFeature = either dumpSometimes dumpAlways