Safe Haskell | None |
---|---|
Language | Haskell2010 |
Distribution.Client.Types.Repo
Synopsis
- data RemoteRepo = RemoteRepo {}
- emptyRemoteRepo :: RepoName -> RemoteRepo
- data LocalRepo = LocalRepo {}
- emptyLocalRepo :: RepoName -> LocalRepo
- localRepoCacheKey :: LocalRepo -> String
- data Repo
- = RepoLocalNoIndex { }
- | RepoRemote { }
- | RepoSecure { }
- repoName :: Repo -> RepoName
- isRepoRemote :: Repo -> Bool
- maybeRepoRemote :: Repo -> Maybe RemoteRepo
- normaliseFileNoIndexURI :: OS -> URI -> URI
Remote repository
data RemoteRepo Source #
Constructors
RemoteRepo | |
Fields
|
Instances
emptyRemoteRepo :: RepoName -> RemoteRepo Source #
Construct a partial RemoteRepo
value to fold the field parser list over.
Local repository (no-index)
no-index style local repositories.
Constructors
LocalRepo | |
Fields |
Instances
Parsec LocalRepo Source # | Note: doesn't parse | ||||
Defined in Distribution.Client.Types.Repo Methods parsec :: CabalParsing m => m LocalRepo # | |||||
Pretty LocalRepo Source # | |||||
Defined in Distribution.Client.Types.Repo | |||||
Structured LocalRepo Source # | |||||
Defined in Distribution.Client.Types.Repo | |||||
Generic LocalRepo Source # | |||||
Defined in Distribution.Client.Types.Repo Associated Types
| |||||
Show LocalRepo Source # | |||||
Binary LocalRepo Source # | |||||
Eq LocalRepo Source # | |||||
Ord LocalRepo Source # | |||||
type Rep LocalRepo Source # | |||||
Defined in Distribution.Client.Types.Repo type Rep LocalRepo = D1 ('MetaData "LocalRepo" "Distribution.Client.Types.Repo" "cabal-install-3.16.0.0-5Or0gjSnsvnBIy2HLcA6Z9" 'False) (C1 ('MetaCons "LocalRepo" 'PrefixI 'True) (S1 ('MetaSel ('Just "localRepoName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RepoName) :*: (S1 ('MetaSel ('Just "localRepoPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "localRepoSharedCache") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
emptyLocalRepo :: RepoName -> LocalRepo Source #
Construct a partial LocalRepo
value to fold the field parser list over.
localRepoCacheKey :: LocalRepo -> String Source #
Calculate a cache key for local-repo.
For remote repositories we just use name, but local repositories may
all be named "local", so we add a bit of localRepoPath
into the
mix.
Repository
Different kinds of repositories
NOTE: It is important that this type remains serializable.
Constructors
RepoLocalNoIndex | Local repository, without index. |
Fields | |
RepoRemote | Standard (unsecured) remote repositories |
Fields | |
RepoSecure | Secure repositories Although this contains the same fields as Not all access to a secure repo goes through the hackage-security
library currently; code paths that do not still make use of the
|
Fields |
Instances
Structured Repo Source # | |||||
Defined in Distribution.Client.Types.Repo | |||||
Generic Repo Source # | |||||
Defined in Distribution.Client.Types.Repo Associated Types
| |||||
Show Repo Source # | |||||
Binary Repo Source # | |||||
Eq Repo Source # | |||||
Ord Repo Source # | |||||
type Rep Repo Source # | |||||
Defined in Distribution.Client.Types.Repo type Rep Repo = D1 ('MetaData "Repo" "Distribution.Client.Types.Repo" "cabal-install-3.16.0.0-5Or0gjSnsvnBIy2HLcA6Z9" 'False) (C1 ('MetaCons "RepoLocalNoIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "repoLocal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalRepo) :*: S1 ('MetaSel ('Just "repoLocalDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: (C1 ('MetaCons "RepoRemote" 'PrefixI 'True) (S1 ('MetaSel ('Just "repoRemote") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RemoteRepo) :*: S1 ('MetaSel ('Just "repoLocalDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "RepoSecure" 'PrefixI 'True) (S1 ('MetaSel ('Just "repoRemote") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RemoteRepo) :*: S1 ('MetaSel ('Just "repoLocalDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))) |
isRepoRemote :: Repo -> Bool Source #
Check if this is a remote repo
maybeRepoRemote :: Repo -> Maybe RemoteRepo Source #
Extract RemoteRepo
from Repo
if remote.
Windows
normaliseFileNoIndexURI :: OS -> URI -> URI Source #
When on Windows, we need to convert the paths in URIs to be POSIX-style.
>>>
import Network.URI
>>>
normaliseFileNoIndexURI Windows (URI "file+noindex:" (Just nullURIAuth) "C:\\dev\\foo" "" "")
file+noindex:C:/dev/foo
Other formats of file paths are not understood by network-uri
:
>>>
import Network.URI
>>>
uriPath <$> parseURI "file+noindex://C:/foo.txt"
Just "/foo.txt">>>
parseURI "file+noindex://C:\foo.txt"
Nothing>>>
uriPath <$> parseURI "file+noindex:///C:/foo.txt"
Just "/C:/foo.txt">>>
uriPath <$> parseURI "file+noindex:C:/foo.txt"
Just "C:/foo.txt"
Out of the ones above, only the last one can be used from anywhere in the system.