Modulecabal-install-3.18.1.0
Distribution.Client.Glob
- 7 types
- 13 values
- Packagecabal-install-3.18.1.0
- Exports20
- LicenceBSD-3-Clause
- SourceGlob.hs
How/does the glob match the given filepath, according to the cabal version? Since this is pure, we don't make a distinction between matching on directories or files (i.e. this function won't return GlobMatchesDirectory)
Extract the matches from a list of GlobResults.
Note: throws away the GlobMissingDirectory results; chances are that you want to check for these and error out if any are present.
Is the root of this relative glob path a directory-recursive wildcard, e.g. **/*.txt ?
This will die' when the glob matches no files, or if the glob
refers to a missing directory, or if the glob fails to parse.
The Version argument must be the spec version of the package
description being processed, as globs behave slightly differently
in different spec versions.
The first FilePath argument is the directory that the glob is relative to. It must be a valid directory (and hence it can't be the empty string). The returned values will not include this prefix.
The second FilePath is the glob itself.
Like matchDirFileGlob but with customizable die
Match a Glob against the file system, starting from a given root directory. The results are all relative to the given root.
Match a globbing pattern against a file path component
runDirFileGlob :: Verbosity-> Maybe CabalSpecVersionIf the glob we are running should care about the cabal spec, and warnings such as GlobWarnMultiDot, then this should be the version. If you want to run a glob but don't care about any of the cabal-spec restrictions on globs, use Nothing!
-> FilePath-> Glob-> IO [GlobResult FilePath]
Match files against a pre-parsed glob, starting in a directory.
The Version argument must be the spec version of the package
description being processed, as globs behave slightly differently
in different spec versions.
The FilePath argument is the directory that the glob is relative to. It must be a valid directory (and hence it can't be the empty string). The returned values will not include this prefix.
Constructors
FilePathRelativeFilePathRoot FilePathe.g.
"/","c:"or result oftakeDriveFilePathHomeDir
Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …
Eq FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesShow FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesGeneric FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesBinary FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesParsec FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesPretty FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesStructured FilePathRootDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.Typestype Rep FilePathRoot = D1 ('MetaDataDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.Types"FilePathRoot"
"Distribution.Simple.FileMonitor.Types"
"Cabal-3.18.1.0-2e60"
'False) (C1 ('MetaCons"FilePathRelative"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"FilePathRoot"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons"FilePathHomeDir"
'PrefixI 'False) U1))
A file path specified by globbing, relative to some root directory.
Constructors
Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …
Eq RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesShow RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesGeneric RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesBinary RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesParsec RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesPretty RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.TypesStructured RootedGlobDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.Typestype Rep RootedGlob = D1 ('MetaDataDefined in Cabal-3.18.1.0 · Distribution.Simple.FileMonitor.Types"RootedGlob"
"Distribution.Simple.FileMonitor.Types"
"Cabal-3.18.1.0-2e60"
'False) (C1 ('MetaCons"RootedGlob"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePathRoot) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Glob)))
Constructors
GlobMatch aThe glob matched the value supplied.
GlobWarnMultiDot aThe glob did not match the value supplied because the cabal-version is too low and the extensions on the file did not precisely match the glob's extensions, but rather the glob was a proper suffix of the file's extensions; i.e., if not for the low cabal-version, it would have matched.
GlobMissingDirectory aThe glob couldn't match because the directory named doesn't exist. The directory will be as it appears in the glob (i.e., relative to the directory passed to matchDirFileGlob, and, for 'data-files', relative to 'data-dir').
GlobMatchesDirectory aThe glob matched a directory when we were looking for files only. It didn't match a file!
Instances4Functor, Eq, Ord, Show
Functor GlobResultDefined in Cabal-3.18.1.0 · Distribution.Simple.GlobEq a => Eq (GlobResult a)Defined in Cabal-3.18.1.0 · Distribution.Simple.GlobOrd a => Ord (GlobResult a)Defined in Cabal-3.18.1.0 · Distribution.Simple.GlobShow a => Show (GlobResult a)Defined in Cabal-3.18.1.0 · Distribution.Simple.Glob
Instances2Eq, Show
Eq GlobSyntaxErrorDefined in Cabal-3.18.1.0 · Distribution.Simple.GlobShow GlobSyntaxErrorDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob
A filepath specified by globbing.
Constructors
GlobDir !GlobPieces !GlobGlobDirRecursive !GlobPiecesGlobFile !GlobPiecesA file glob.
GlobDirTrailingTrailing dir; a glob ending in
/.
Instances8Eq, Show, Generic, Binary, Parsec, Pretty, …
Eq GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalShow GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalGeneric GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalBinary GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalParsec GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalPretty GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalStructured GlobDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.Internaltype Rep Glob = D1 ('MetaDataDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.Internal"Glob"
"Distribution.Simple.Glob.Internal"
"Cabal-3.18.1.0-2e60"
'False) ((C1 ('MetaCons"GlobDir"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Glob)) :+: C1 ('MetaCons"GlobDirRecursive"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces))) :+: (C1 ('MetaCons"GlobFile"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobPieces)) :+: C1 ('MetaCons"GlobDirTrailing"
'PrefixI 'False) U1))
A piece of a globbing pattern
Constructors
WildCardA wildcard
*Literal StringA literal string
dirABCUnion [GlobPieces]A union of patterns, e.g.
dir{a,*.txt,c}...
Instances6Eq, Show, Generic, Binary, Structured, Rep
Eq GlobPieceDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalShow GlobPieceDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalGeneric GlobPieceDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalBinary GlobPieceDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.InternalStructured GlobPieceDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.Internaltype Rep GlobPiece = D1 ('MetaDataDefined in Cabal-3.18.1.0 · Distribution.Simple.Glob.Internal"GlobPiece"
"Distribution.Simple.Glob.Internal"
"Cabal-3.18.1.0-2e60"
'False) (C1 ('MetaCons"WildCard"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Literal"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons"Union"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GlobPieces]))))
A single directory or file component of a globbed path