From de3b22c356fe5da3fdff8f746b3333cfbfce7d34 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 10 Feb 2021 23:13:33 -0800 Subject: EPUB writer: use SOURCE_DATE_EPOCH for modification date. This enables reproducible builds. --- src/Text/Pandoc/Writers/EPUB.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index e99fa2567..af4f8ef7d 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -191,7 +191,7 @@ getEPUBMetadata opts meta = do let fixDate m = if null (epubDate m) then do - currentTime <- lift P.getCurrentTime + currentTime <- lift P.getSourceDateEpoch return $ m{ epubDate = [ Date{ dateText = showDateTimeISO8601 currentTime , dateEvent = Nothing } ] } @@ -709,7 +709,7 @@ pandocToEPUB version opts doc = do uuid <- case epubIdentifier metadata of (x:_) -> return $ identifierText x -- use first identifier as UUID [] -> throwError $ PandocShouldNeverHappenError "epubIdentifier is null" -- shouldn't happen - currentTime <- lift P.getCurrentTime + currentTime <- lift P.getSourceDateEpoch let contentsData = UTF8.fromStringLazy $ ppTopElement $ unode "package" ! ([("version", case version of -- cgit v1.2.3