From a91428c806c8502d6c01c4b0cdaf48b06cb0f0d6 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Tue, 19 Jul 2016 22:32:39 +0200
Subject: [PATCH] stack sdist: Fix timestamp in tarball
---
src/Stack/SDist.hs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Stack/SDist.hs b/src/Stack/SDist.hs
index 32b09a11c0..1dbe6f271b 100644
--- a/src/Stack/SDist.hs
+++ b/src/Stack/SDist.hs
@@ -108,7 +108,8 @@ getSDistTarball mpvpBounds pkgDir = do
packFile fp
| tweakCabal && isCabalFp fp = do
lbs <- getCabalLbs pvpBounds $ toFilePath cabalfp
- return $ Tar.fileEntry (tarPath False fp) lbs
+ currTime <- liftIO getPOSIXTime -- Seconds from UNIX epoch
+ return $ (Tar.fileEntry (tarPath False fp) lbs) { Tar.entryTime = floor currTime }
| otherwise = packWith packFileEntry False fp
isCabalFp fp = toFilePath pkgDir FP.> fp == toFilePath cabalfp
tarName = pkgId FP.<.> "tar.gz"