hpack 0.19.1 → 0.19.2
raw patch · 2 files changed
+19/−3 lines, 2 filesdep ~GlobPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Glob
API changes (from Hackage documentation)
Files
- hpack.cabal +2/−2
- src/Hpack/Util.hs +17/−1
hpack.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.19.0.+-- This file has been generated from package.yaml by hpack version 0.19.1. -- -- see: https://github.com/sol/hpack name: hpack-version: 0.19.1+version: 0.19.2 synopsis: An alternative format for Haskell packages description: See README at <https://github.com/sol/hpack#readme> category: Development
src/Hpack/Util.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} module Hpack.Util ( List(..)@@ -116,14 +117,29 @@ expandGlobs :: String -> FilePath -> [String] -> IO ([String], [FilePath]) expandGlobs name dir patterns = do- files <- (fst <$> globDir compiledPatterns dir) >>= mapM removeDirectories+ files <- globDir_ compiledPatterns dir >>= mapM removeDirectories let warnings = [warn pattern | ([], pattern) <- zip files patterns] return (warnings, combineResults files) where+ globDir_ :: [Pattern] -> FilePath -> IO [[FilePath]]+#if MIN_VERSION_Glob(0,9,0)+ globDir_ = globDir+#else+ globDir_ xs = fmap fst . globDir xs+#endif+ combineResults :: [[FilePath]] -> [FilePath] combineResults = nub . sort . map (toPosixFilePath . makeRelative dir) . concat++ warn :: String -> String warn pattern = "Specified pattern " ++ show pattern ++ " for " ++ name ++ " does not match any files"++ compiledPatterns :: [Pattern] compiledPatterns = map (compileWith options) patterns++ removeDirectories :: [FilePath] -> IO [FilePath] removeDirectories = filterM doesFileExist++ options :: CompOptions options = CompOptions { characterClasses = False , characterRanges = False