summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorongyerth <>2020-02-13 17:28:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-02-13 17:28:00 (GMT)
commit9552479feb8fb50ca03515eb5c0471d9c513b9f2 (patch)
tree82352166b3ffc5bdf330cab2a0286d0fdc5092ac
parent4c697dc89ddec7eccb460f3575d79f80b8ddb447 (diff)
version 2.2.1.1HEAD2.2.1.1master
-rw-r--r--Monky/Examples/Utility.hs3
-rw-r--r--Monky/MPD.hs7
-rw-r--r--Monky/Network/Static.hs1
-rw-r--r--monky.cabal4
4 files changed, 11 insertions, 4 deletions
diff --git a/Monky/Examples/Utility.hs b/Monky/Examples/Utility.hs
index ca22579..f59ee69 100644
--- a/Monky/Examples/Utility.hs
+++ b/Monky/Examples/Utility.hs
@@ -40,6 +40,7 @@ import Formatting
import Control.Monad (unless)
import Control.Concurrent (threadWaitRead)
+import Data.Scientific (fromFloatDigits, FPFormat(Exponent))
import System.Posix.Types (Fd)
import Monky.Modules
@@ -84,7 +85,7 @@ convertUnitT rate step bs ks ms gs
| rate < fromIntegral (gf * 10 ) = sformat ((left 4 ' ' %. fixed 2) % stext) gv gs
| rate < fromIntegral (gf * 100 ) = sformat ((left 4 ' ' %. fixed 1) % stext) gv gs
| rate < fromIntegral (gf * 1000) = sformat ((left 4 ' ' %. fixed 0) % stext) gv gs
- | otherwise = sformat ((left 4 ' ' %. expt 1) % stext) gv gs
+ | otherwise = sformat ((left 4 ' ' %. scifmt Exponent Nothing) % stext) (fromFloatDigits gv) gs
where
kf = 1 * step
mf = kf * step
diff --git a/Monky/MPD.hs b/Monky/MPD.hs
index 500c88d..31b54c1 100644
--- a/Monky/MPD.hs
+++ b/Monky/MPD.hs
@@ -217,7 +217,12 @@ getMPDSocket host port = do
-- |Get the raw 'Fd' from the 'MPDSocket' for eventing api
getMPDFd :: MPDSocket -> IO Fd
-getMPDFd (MPDSocket s) = return . Fd $fdSocket s
+getMPDFd (MPDSocket s) =
+#if MIN_VERSION_network(3,0,0)
+ Fd <$> unsafeFdSocket s
+#else
+ pure . Fd $ fdSocket s
+#endif
recvMessage :: MPDSock -> ExceptT String IO [Text]
diff --git a/Monky/Network/Static.hs b/Monky/Network/Static.hs
index fd05d41..96c2436 100644
--- a/Monky/Network/Static.hs
+++ b/Monky/Network/Static.hs
@@ -56,6 +56,7 @@ getState (NetH _ _ statef _ _ _) = do
"down" -> Down
"unknown" -> Unknown
"dormant" -> Dormant
+ "lowerlayerdown" -> Down
_ -> error ("Don't know the network state \"" ++ state ++ "\" yet")
diff --git a/monky.cabal b/monky.cabal
index 1d49949..2f8979d 100644
--- a/monky.cabal
+++ b/monky.cabal
@@ -10,7 +10,7 @@ name: monky
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
-version: 2.2.1.0
+version: 2.2.1.1
-- The ABOVE LINE has to stay AS IS (except for version changes) for the
-- template to work properly
@@ -158,7 +158,7 @@ library
build-depends: text, unix, network, mtl, transformers
build-depends: template-haskell, containers, stm, statvfs
build-depends: bytestring, netlink >= 1.1, cereal, formatting, composition
- build-depends: env-locale >= 1.0.0.1
+ build-depends: env-locale >= 1.0.0.1, scientific
-- force double-conversion version for old ghc/library?
if impl(ghc < 7.8)