| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Stack.Fetch
Description
Functionality for downloading packages securely for cabal's usage.
- unpackPackages :: HasConfig env => Maybe SnapshotDef -> FilePath -> [String] -> RIO env ()
- unpackPackageIdent :: HasConfig env => Path Abs Dir -> Path Rel Dir -> PackageIdentifierRevision -> RIO env (Path Abs Dir)
- unpackPackageIdents :: HasConfig env => Path Abs Dir -> Maybe (Path Rel Dir) -> [PackageIdentifierRevision] -> RIO env (Map PackageIdentifier (Path Abs Dir))
- fetchPackages :: HasConfig env => Set PackageIdentifier -> RIO env ()
- untar :: forall b1 b2. Path b1 File -> Path Rel Dir -> Path b2 Dir -> IO [(FilePath, Text)]
- resolvePackages :: HasConfig env => Maybe SnapshotDef -> [PackageIdentifierRevision] -> Set PackageName -> RIO env [ResolvedPackage]
- resolvePackagesAllowMissing :: forall env. HasConfig env => Maybe SnapshotDef -> [PackageIdentifierRevision] -> Set PackageName -> RIO env (Set PackageName, HashSet PackageIdentifierRevision, [ResolvedPackage])
- data ResolvedPackage = ResolvedPackage {}
- withCabalFiles :: (MonadReader env m, MonadUnliftIO m, HasConfig env, MonadThrow m) => IndexName -> [(ResolvedPackage, a)] -> (PackageIdentifier -> a -> ByteString -> IO b) -> m [b]
- withCabalLoader :: HasConfig env => ((PackageIdentifierRevision -> IO ByteString) -> RIO env a) -> RIO env a
Documentation
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.
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.
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.
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).
data ResolvedPackage Source #
Constructors
| ResolvedPackage | |
Fields
| |
Instances
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.