cabal-meta 0.2.1 → 0.2.2
raw patch · 4 files changed
+22/−14 lines, 4 filesdep ~shellyPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: shelly
API changes (from Hackage documentation)
Files
- CabalMeta.hs +5/−5
- cabal-meta.cabal +5/−5
- main.hs +11/−3
- test/main.hs +1/−1
CabalMeta.hs view
@@ -1,11 +1,11 @@ {-# LANGUAGE CPP, OverloadedStrings #-} module CabalMeta where -import Shelly+import Shelly hiding (tag) import Prelude hiding (FilePath) import Data.Text.Lazy (Text, unpack) import qualified Data.Text.Lazy as T-import Filesystem.Path.CurrentOS (FilePath, hasExtension, filename)+import Filesystem.Path.CurrentOS (hasExtension, filename) import Data.Maybe (fromMaybe, maybeToList) import Data.List (partition) @@ -78,7 +78,7 @@ readPackages :: Bool -> FilePath -> ShIO PackageSources readPackages allowCabals startDir = do- fullDir <- path startDir+ fullDir <- absPath startDir chdir fullDir $ do cabalPresent <- if allowCabals then return False else isCabalPresent if cabalPresent then return mempty else do@@ -102,7 +102,7 @@ readPackages False d child_dir_pkgs <- forM (dirs psources) $ \dir -> do- b <- fmap (== fullDir) (path $ dLocation dir)+ b <- fmap (== fullDir) (absPath $ dLocation dir) if b then return mempty else readPackages False (dLocation dir) let child_pkgs = child_dir_pkgs ++ child_vendor_pkgs@@ -136,7 +136,7 @@ return $ sources { dirs = ds } where fullPath package = do- fp <- path $ dLocation package+ fp <- absPath $ dLocation package return package { dLocation = fp } paritionSources :: [[Text]] -> PackageSources
cabal-meta.cabal view
@@ -1,5 +1,5 @@ name: cabal-meta-version: 0.2.1+version: 0.2.2 license: BSD3 license-file: LICENSE author: Greg Weber <greg@gregweber.info>@@ -21,9 +21,9 @@ cpp-options: -DGHC7 else build-depends: base >= 4 && < 4.3- build-depends: shelly >= 0.6+ build-depends: shelly >= 0.9 , text, system-filepath- -- , file-location+ -- , file-location extensions: OverloadedStrings exposed-modules: CabalMeta @@ -35,7 +35,7 @@ cpp-options: -DGHC7 else build-depends: base >= 4 && < 4.3- build-depends: shelly >= 0.3.1+ build-depends: shelly >= 0.9 , text, system-filepath -- , file-location @@ -48,7 +48,7 @@ hs-source-dirs: . type: exitcode-stdio-1.0 - build-depends: shelly >= 0.3.1+ build-depends: shelly >= 0.9 , hspec, HUnit, unix, base, text, system-filepath -- , file-location extensions: OverloadedStrings
main.hs view
@@ -4,12 +4,11 @@ import System.Environment (getArgs) import qualified Data.Text.Lazy as T-import Control.Monad (forM_, when, unless)--- import Filesystem.Path.CurrentOS (decodeString)+import Control.Monad (forM_) import Data.Maybe (isNothing) import Data.Text.Lazy (Text, pack) -import Filesystem.Path.CurrentOS (FilePath, filename)+import Filesystem.Path.CurrentOS (filename) import Prelude hiding (FilePath) headDef :: a -> [a] -> a@@ -35,6 +34,14 @@ progName Cabal = "cabal" progName CabalDev = "cabal-dev" +assertCabalDevInstalled :: CabalExe -> ShIO ()+assertCabalDevInstalled Cabal = return ()+assertCabalDevInstalled CabalDev = do+ mcd <- which "cabal-dev"+ case mcd of+ Just _ -> return ()+ Nothing -> error "--dev requires cabal-dev to be installed"+ main :: IO () main = do cmdArgs <- fmap (map pack) getArgs@@ -43,6 +50,7 @@ noDevArgs = filter (/= "--dev") cmdArgs cabal = if isDev then CabalDev else Cabal + assertCabalDevInstalled cabal unless (headDef "" noDevArgs == "install") $ errorExit help
test/main.hs view
@@ -9,7 +9,7 @@ import Filesystem.Path.CurrentOS hiding (fromText, (</>)) main :: IO ()-main = hspecX $+main = hspec $ it "gets the packages" $ do (psources, wd) <- shelly $ verbosely $ do ps <- readPackages True "test"