Commit 2b7be354 authored by quasicomputational's avatar quasicomputational Committed by Mikhail Glushenkov
Browse files

Remove matchFileGlob.

This was only a convenience function, but its use could obscure how it
is introducing a dependency on the CWD. By removing it, the "."
argument to `matchDirFileGlob` is explicit.

Any external code using `matchFileGlob` would have needed to be
changed as #5284 changed its signature and the module it lives in; it
is not much more of a burden to switch to `matchDirFileGlob` at the
same time.
parent 2e78642a
......@@ -18,7 +18,6 @@ module Distribution.Simple.Glob (
GlobSyntaxError(..),
GlobResult(..),
globMatches,
matchFileGlob,
matchDirFileGlob,
matchDirFileGlob',
fileGlobMatches,
......@@ -193,9 +192,6 @@ parseFileGlob version filepath = case reverse (splitDirectories filepath) of
| version >= mkVersion [2,4] = MultiDotEnabled
| otherwise = MultiDotDisabled
matchFileGlob :: Verbosity -> Version -> FilePath -> IO [GlobResult FilePath]
matchFileGlob verbosity version = matchDirFileGlob verbosity version "."
-- | Like 'matchDirFileGlob'', but will 'die'' when the glob matches
-- no files.
matchDirFileGlob :: Verbosity -> Version -> FilePath -> FilePath -> IO [GlobResult FilePath]
......
......@@ -306,7 +306,7 @@ haddock pkg_descr lbi suffixes flags' = do
CBench _ -> (when (flag haddockBenchmarks) $ smsg >> doExe component) >> return index
for_ (extraDocFiles pkg_descr) $ \ fpath -> do
files <- fmap globMatches $ matchFileGlob verbosity (specVersion pkg_descr) fpath
files <- fmap globMatches $ matchDirFileGlob verbosity (specVersion pkg_descr) "." fpath
for_ files $ copyFileTo verbosity (unDir $ argOutputDir commonArgs)
-- ------------------------------------------------------------------------------
......
......@@ -149,7 +149,7 @@ listPackageSourcesMaybeExecutable verbosity pkg_descr =
-- Extra source files.
fmap concat . for (extraSrcFiles pkg_descr) $ \fpath ->
fmap globMatches $
matchFileGlob verbosity (specVersion pkg_descr) fpath
matchDirFileGlob verbosity (specVersion pkg_descr) "." fpath
-- | List those source files that should be copied with ordinary permissions.
listPackageSourcesOrdinary :: Verbosity
......@@ -223,7 +223,7 @@ listPackageSourcesOrdinary verbosity pkg_descr pps =
, fmap concat
. for (extraDocFiles pkg_descr) $ \ filename ->
fmap globMatches $
matchFileGlob verbosity (specVersion pkg_descr) filename
matchDirFileGlob verbosity (specVersion pkg_descr) "." filename
-- License file(s).
, return (licenseFiles pkg_descr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment