Skip to content

Commit 886a500

Browse files
committed
Normalize creator bytes so it is truly correct
1 parent ef8ae9c commit 886a500

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cabal-install/Distribution/Client/CmdSdist.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE MultiWayIf #-}
22
{-# LANGUAGE NamedFieldPuns #-}
3+
{-# LANGUAGE OverloadedStrings #-}
34
{-# LANGUAGE RecordWildCards #-}
45
{-# LANGUAGE TupleSections #-}
56
{-# LANGUAGE ViewPatterns #-}
@@ -222,6 +223,12 @@ packageToSdist verbosity listSources archiveFormat outputFile pkg = do
222223
Right path -> tell [(Tar.fileEntry path contents) { Tar.entryPermissions = perm' }]
223224

224225
entries <- execWriterT (evalStateT entriesM [])
226+
let
227+
-- Pretend our GZip file is made on Unix.
228+
normalize bs = BSL.concat [first, "\x03", rest']
229+
where
230+
(first, rest) = BSL.splitAt 9 bs
231+
rest' = BSL.tail rest
225232
write . GZip.compress . Tar.write $ entries
226233
notice verbosity $ "Wrote tarball sdist to " ++ outputFile ++ "\n"
227234
| archiveFormat == ZipFormat -> do
Binary file not shown.

0 commit comments

Comments
 (0)