Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 52 lines 2.0 kB view raw
1diff -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 #-} 6 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" 21diff -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 #-} 27 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" 41diff -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 46 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 52