stack-1.6.5: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Fetch

Description

Functionality for downloading packages securely for cabal's usage.

Synopsis

Documentation

unpackPackages Source #

Arguments

:: HasConfig env 
=> Maybe SnapshotDef

when looking up by name, take from this build plan

-> FilePath

destination

-> [String]

names or identifiers

-> RIO env () 

Intended to work for the command line command.

unpackPackageIdent Source #

Arguments

:: HasConfig env 
=> Path Abs Dir

unpack directory

-> Path Rel Dir

the dist rename directory, see: https://github.com/fpco/stack/issues/157

-> PackageIdentifierRevision 
-> RIO env (Path Abs Dir) 

Same as unpackPackageIdents, but for a single package.

unpackPackageIdents Source #

Arguments

:: HasConfig env 
=> Path Abs Dir

unpack directory

-> Maybe (Path Rel Dir)

the dist rename directory, see: https://github.com/fpco/stack/issues/157

-> [PackageIdentifierRevision] 
-> RIO env (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 :: HasConfig env => Set PackageIdentifier -> RIO env () Source #

Fetch packages into the cache without unpacking

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

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 Source #

Arguments

:: HasConfig env 
=> Maybe SnapshotDef

when looking up by name, take from this build plan

-> [PackageIdentifierRevision] 
-> Set PackageName 
-> RIO env [ResolvedPackage] 

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

resolvePackagesAllowMissing Source #

Arguments

:: HasConfig env 
=> Maybe SnapshotDef

when looking up by name, take from this build plan

-> [PackageIdentifierRevision] 
-> Set PackageName 
-> RIO env (Set PackageName, HashSet PackageIdentifierRevision, [ResolvedPackage]) 

Turn package identifiers and package names into a list of ResolvedPackages. Returns any unresolved names and identifier. These are considered unresolved even if the only mismatch is in the cabal file info (MSS 2017-07-17: old versions of this code had special handling to treat missing cabal file info as a warning, that's no longer necessary or desirable since all info should be present and checked).

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

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

withCabalLoader :: HasConfig env => ((PackageIdentifierRevision -> IO ByteString) -> RIO env a) -> RIO env a Source #

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