From 2f9523feb2e108dcb731e08ec467ad06edecdd39 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 31 Mar 2019 20:18:10 +0200 Subject: Fix datecode padding in unpackCabalHEAD --- src/CabalHelper/Compiletime/Cabal.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CabalHelper/Compiletime/Cabal.hs b/src/CabalHelper/Compiletime/Cabal.hs index 3ffb670..69817c7 100644 --- a/src/CabalHelper/Compiletime/Cabal.hs +++ b/src/CabalHelper/Compiletime/Cabal.hs @@ -198,7 +198,8 @@ unpackCabalHEAD tmpdir = do let ut = posixSecondsToUTCTime $ fromInteger (read ts) (y,m,d) = toGregorian $ utctDay ut sec = round $ utctDayTime ut - datecode = read $ show y ++ show m ++ show d ++ printf "%5d\n" sec + datecode = + read $ show y ++ printf "%02d" m ++ printf "%02d" d ++ printf "%05d" sec sec :: Int; datecode :: Int let cabal_file = tmpdir "Cabal/Cabal.cabal" cf0 <- readFile cabal_file -- cgit v1.2.3