easytier: 2.1.1 -> 2.1.2 (#376259)
[NixPkgs.git] / pkgs / development / haskell-modules / patches / mbox-time-1.10.patch
blobf72b8483b339e5aaf422f9195ed7128f642d79d9
1 diff -rN -u old-mbox/Data/MBox/String.hs new-mbox/Data/MBox/String.hs
2 --- old-mbox/Data/MBox/String.hs 2022-11-22 19:14:52.332543098 +0100
3 +++ new-mbox/Data/MBox/String.hs 2022-11-22 19:14:52.332543098 +0100
4 @@ -1,3 +1,4 @@
5 +{-# LANGUAGE CPP #-}
7 -----------------------------------------------------------------------------
8 {- |
9 @@ -31,7 +32,11 @@
10 -- | Reads a date header as a UTCTime
11 parseDateHeader :: String -> Maybe UTCTime
12 parseDateHeader header = listToMaybe . catMaybes $ map tryParse formats where
13 +#if MIN_VERSION_time(1,9,0)
14 + tryParse f = parseTimeM True LC.defaultTimeLocale f header
15 +#else
16 tryParse f = parseTime LC.defaultTimeLocale f header
17 +#endif
18 formats =
19 [ "%a, %_d %b %Y %T %z"
20 , "%a, %_d %b %Y %T %Z"
21 diff -rN -u old-mbox/Data/MBox.hs new-mbox/Data/MBox.hs
22 --- old-mbox/Data/MBox.hs 2022-11-22 19:14:52.332543098 +0100
23 +++ new-mbox/Data/MBox.hs 2022-11-22 19:14:52.332543098 +0100
24 @@ -1,3 +1,4 @@
25 +{-# LANGUAGE CPP #-}
26 {-# LANGUAGE ViewPatterns #-}
28 -----------------------------------------------------------------------------
29 @@ -34,7 +35,11 @@
30 parseDateHeader :: T.Text -> Maybe UTCTime
31 parseDateHeader txt = listToMaybe . catMaybes $ map tryParse formats where
32 header = T.unpack txt
33 +#if MIN_VERSION_time(1,9,0)
34 + tryParse f = parseTimeM True LC.defaultTimeLocale f header
35 +#else
36 tryParse f = parseTime LC.defaultTimeLocale f header
37 +#endif
38 formats =
39 [ "%a, %_d %b %Y %T %z"
40 , "%a, %_d %b %Y %T %Z"
41 diff -rN -u old-mbox/mbox.cabal new-mbox/mbox.cabal
42 --- old-mbox/mbox.cabal 2022-11-22 19:14:52.332543098 +0100
43 +++ new-mbox/mbox.cabal 2022-11-22 19:14:52.332543098 +0100
44 @@ -13,7 +13,7 @@
45 Cabal-Version: >= 1.6
47 library
48 - build-depends: base >= 4, base < 6, safe, time < 1.9, time-locale-compat, text
49 + build-depends: base >= 4, base < 6, safe, time, time-locale-compat, text
50 exposed-modules: Data.MBox, Data.MBox.String
51 ghc-options: -Wall