Skip to content

Commit 8caceff

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 haskell#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.
1 parent 38c06d4 commit 8caceff

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Cabal/Distribution/Simple/Glob.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module Distribution.Simple.Glob (
1818
GlobSyntaxError(..),
1919
GlobResult(..),
2020
globMatches,
21-
matchFileGlob,
2221
matchDirFileGlob,
2322
matchDirFileGlob',
2423
fileGlobMatches,
@@ -193,9 +192,6 @@ parseFileGlob version filepath = case reverse (splitDirectories filepath) of
193192
| version >= mkVersion [2,4] = MultiDotEnabled
194193
| otherwise = MultiDotDisabled
195194

196-
matchFileGlob :: Verbosity -> Version -> FilePath -> IO [GlobResult FilePath]
197-
matchFileGlob verbosity version = matchDirFileGlob verbosity version "."
198-
199195
-- | Like 'matchDirFileGlob'', but will 'die'' when the glob matches
200196
-- no files.
201197
matchDirFileGlob :: Verbosity -> Version -> FilePath -> FilePath -> IO [GlobResult FilePath]

Cabal/Distribution/Simple/Haddock.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ haddock pkg_descr lbi suffixes flags' = do
306306
CBench _ -> (when (flag haddockBenchmarks) $ smsg >> doExe component) >> return index
307307

308308
for_ (extraDocFiles pkg_descr) $ \ fpath -> do
309-
files <- fmap globMatches $ matchFileGlob verbosity (specVersion pkg_descr) fpath
309+
files <- fmap globMatches $ matchDirFileGlob verbosity (specVersion pkg_descr) "." fpath
310310
for_ files $ copyFileTo verbosity (unDir $ argOutputDir commonArgs)
311311

312312
-- ------------------------------------------------------------------------------

Cabal/Distribution/Simple/SrcDist.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ listPackageSourcesMaybeExecutable verbosity pkg_descr =
149149
-- Extra source files.
150150
fmap concat . for (extraSrcFiles pkg_descr) $ \fpath ->
151151
fmap globMatches $
152-
matchFileGlob verbosity (specVersion pkg_descr) fpath
152+
matchDirFileGlob verbosity (specVersion pkg_descr) "." fpath
153153

154154
-- | List those source files that should be copied with ordinary permissions.
155155
listPackageSourcesOrdinary :: Verbosity
@@ -223,7 +223,7 @@ listPackageSourcesOrdinary verbosity pkg_descr pps =
223223
, fmap concat
224224
. for (extraDocFiles pkg_descr) $ \ filename ->
225225
fmap globMatches $
226-
matchFileGlob verbosity (specVersion pkg_descr) filename
226+
matchDirFileGlob verbosity (specVersion pkg_descr) "." filename
227227

228228
-- License file(s).
229229
, return (licenseFiles pkg_descr)

0 commit comments

Comments
 (0)