Commit c4e82fb9 authored by Alexis Williams's avatar Alexis Williams
Browse files

Fix zip sdists as well

parent 0f25e890
...@@ -273,6 +273,7 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do ...@@ -273,6 +273,7 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do
when (outputFile /= "-") $ when (outputFile /= "-") $
notice verbosity $ "Wrote tarball sdist to " ++ outputFile ++ "\n" notice verbosity $ "Wrote tarball sdist to " ++ outputFile ++ "\n"
Archive ZipFormat -> do Archive ZipFormat -> do
let prefix = prettyShow (packageId pkg)
entries <- forM files $ \(perm, file) -> do entries <- forM files $ \(perm, file) -> do
let perm' = case perm of let perm' = case perm of
-- -rwxr-xr-x -- -rwxr-xr-x
...@@ -280,7 +281,7 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do ...@@ -280,7 +281,7 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do
-- -rw-r--r-- -- -rw-r--r--
NoExec -> 0o010644 `shiftL` 16 NoExec -> 0o010644 `shiftL` 16
contents <- BSL.readFile file contents <- BSL.readFile file
return $ (Zip.toEntry file 0 contents) { Zip.eExternalFileAttributes = perm' } return $ (Zip.toEntry (prefix </> file) 0 contents) { Zip.eExternalFileAttributes = perm' }
let archive = foldr Zip.addEntryToArchive Zip.emptyArchive entries let archive = foldr Zip.addEntryToArchive Zip.emptyArchive entries
write (Zip.fromArchive archive) write (Zip.fromArchive archive)
when (outputFile /= "-") $ when (outputFile /= "-") $
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment