stack-1.4.0: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Fetch

Description

Functionality for downloading packages securely for cabal's usage.

Synopsis

- unpackPackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> Maybe MiniBuildPlan -> FilePath -> [String] -> m ()
- unpackPackageIdents :: (StackMiniM env m, HasConfig env) => EnvOverride -> Path Abs Dir -> Maybe (Path Rel Dir) -> Map PackageIdentifier (Maybe GitSHA1) -> m (Map PackageIdentifier (Path Abs Dir))
- fetchPackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> Set PackageIdentifier -> m ()
- untar :: forall b1 b2. Path b1 File -> Path Rel Dir -> Path b2 Dir -> IO [(FilePath, Text)]
- resolvePackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> Maybe MiniBuildPlan -> Map PackageIdentifier (Maybe GitSHA1) -> Set PackageName -> m [ResolvedPackage]
- resolvePackagesAllowMissing :: (StackMiniM env m, HasConfig env) => EnvOverride -> Maybe MiniBuildPlan -> Map PackageIdentifier (Maybe GitSHA1) -> Set PackageName -> m (Set PackageName, Set PackageIdentifier, [ResolvedPackage])
- data ResolvedPackage = ResolvedPackage {
  - rpIdent :: !PackageIdentifier
  - rpCache :: !PackageCache
  - rpIndex :: !PackageIndex
  - rpGitSHA1 :: !(Maybe GitSHA1)
  - rpMissingGitSHA :: !Bool
  }
- withCabalFiles :: (StackMiniM env m, HasConfig env) => IndexName -> [(ResolvedPackage, a)] -> (PackageIdentifier -> a -> ByteString -> IO b) -> m [b]
- withCabalLoader :: (StackMiniM env m, HasConfig env, MonadBaseUnlift IO m) => EnvOverride -> ((PackageIdentifier -> IO ByteString) -> m a) -> m a

# Documentation

unpackPackages #

Arguments

:: (StackMiniM env m, HasConfig env) |
=> EnvOverride |
-> Maybe MiniBuildPlan | when looking up by name, take from this build plan
-> FilePath | destination
-> [String] | names or identifiers
-> m () |

Intended to work for the command line command.

unpackPackageIdents #

Arguments

:: (StackMiniM env m, HasConfig env) |
=> EnvOverride |
-> Path Abs Dir | unpack directory
-> Maybe (Path Rel Dir) | the dist rename directory, see: https://github.com/fpco/stack/issues/157
-> Map PackageIdentifier (Maybe GitSHA1) |
-> m (Map PackageIdentifier (Path Abs Dir)) |

Ensure that all of the given package idents are unpacked into the build unpack directory, and return the paths to all of the subdirectories.

fetchPackages :: (StackMiniM env m, HasConfig env) => EnvOverride -> Set PackageIdentifier -> m () #

Fetch packages into the cache without unpacking

untar :: forall b1 b2. Path b1 File -> Path Rel Dir -> Path b2 Dir -> IO [(FilePath, Text)] #

Internal function used to unpack tarball.

Takes a path to a .tar.gz file, the name of the directory it should contain, and a destination folder to extract the tarball into. Returns unexpected entries, as pairs of paths and descriptions.

resolvePackages #

Arguments

:: (StackMiniM env m, HasConfig env) |
=> EnvOverride |
-> Maybe MiniBuildPlan | when looking up by name, take from this build plan
-> Map PackageIdentifier (Maybe GitSHA1) |
-> Set PackageName |
-> m [ResolvedPackage] |

Resolve a set of package names and identifiers into `FetchPackage` values.

resolvePackagesAllowMissing #

Arguments

:: (StackMiniM env m, HasConfig env) |
=> EnvOverride |
-> Maybe MiniBuildPlan | when looking up by name, take from this build plan
-> Map PackageIdentifier (Maybe GitSHA1) |
-> Set PackageName |
-> m (Set PackageName, Set PackageIdentifier, [ResolvedPackage]) |

data ResolvedPackage #

Constructors

ResolvedPackage |
Fields rpIdent :: !PackageIdentifier rpCache :: !PackageCache rpIndex :: !PackageIndex rpGitSHA1 :: !(Maybe GitSHA1) rpMissingGitSHA :: !Bool

Instances

Show ResolvedPackage # |
Methods showsPrec :: Int -> ResolvedPackage -> ShowS # show :: ResolvedPackage -> String # showList :: [ResolvedPackage] -> ShowS #

withCabalFiles :: (StackMiniM env m, HasConfig env) => IndexName -> [(ResolvedPackage, a)] -> (PackageIdentifier -> a -> ByteString -> IO b) -> m [b] #

Add the cabal files to a list of idents with their caches.

withCabalLoader :: (StackMiniM env m, HasConfig env, MonadBaseUnlift IO m) => EnvOverride -> ((PackageIdentifier -> IO ByteString) -> m a) -> m a #

Provide a function which will load up a cabal `ByteString` from the package indices.