1module Stackage.Tarballs
5import qualified Codec.Archive.Tar as Tar
6import qualified Data.ByteString.Lazy as L
7import qualified Data.Map as Map
8import qualified Data.Set as Set
11import System.Directory (createDirectoryIfMissing)
12import System.FilePath (takeDirectory)
14makeTarballs :: BuildPlan -> IO ()
16 putStrLn "Building tarballs"
17 tarName <- getTarballName
18 origEntries <- fmap Tar.read $ L.readFile tarName
19 (stableEntries, extraEntries) <- loop id id origEntries
21 (stableTar, extraTar) <- getStackageTarballNames
23 createDirectoryIfMissing True $ takeDirectory stableTar
24 L.writeFile stableTar $ Tar.write stableEntries
26 createDirectoryIfMissing True $ takeDirectory extraTar
27 L.writeFile extraTar $ Tar.write extraEntries
29 -- Using "error . show" for compatibility with tar 0.3 and 0.4
30 loop _ _ (Tar.Fail err) = error $ show err
31 loop stable extra Tar.Done = return (stable [], extra [])
32 loop stable extra (Tar.Next e es) =
33 loop stable' extra' es
36 case getPackageVersion e of
37 Nothing -> (stable, extra)
38 Just (package, version) ->
39 case Map.lookup package $ bpPackages bp of
41 | version == spiVersion spi -> (stable . (e:), extra)
42 | otherwise -> (stable, extra)
44 | package `Map.member` bpCore bp -> (stable, extra)
45 | otherwise -> (stable, extra . (e:))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list