diff --git a/Cabal/src/Distribution/Simple/Glob.hs b/Cabal/src/Distribution/Simple/Glob.hs index 1a6c0594575..aa982131846 100644 --- a/Cabal/src/Distribution/Simple/Glob.hs +++ b/Cabal/src/Distribution/Simple/Glob.hs @@ -518,17 +518,7 @@ runDirFileGlob verbosity mspec rawRoot pat = do entries <- getDirectoryContents (root dir) catMaybes <$> mapM - ( \s -> do - -- When running a glob from a Cabal package description (i.e. - -- when a cabal spec version is passed as an argument), we - -- disallow matching a @GlobFile@ against a directory, preferring - -- @GlobDir dir GlobDirTrailing@ to specify a directory match. - shouldMatch <- maybe (return True) (const $ doesFileExist (root dir s)) mspec - return $ - if shouldMatch - then (dir s <$) <$> doesGlobMatch glob s - else Nothing - ) + (\s -> return $ (dir s <$) <$> doesGlobMatch glob s) entries go (GlobDirRecursive glob) dir = do entries <- getDirectoryContentsRecursive (root dir)