cab 0.2.14 → 0.2.15
raw patch · 4 files changed
+31/−9 lines, 4 filesdep ~Cabaldep ~processPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Cabal, process
API changes (from Hackage documentation)
Files
- Distribution/Cab/GenPaths.hs +1/−0
- Distribution/Cab/PkgDB.hs +14/−5
- cab.cabal +3/−3
- src/Run.hs +13/−1
Distribution/Cab/GenPaths.hs view
@@ -50,4 +50,5 @@ [] -> throwIO $ userError "Cabal file does not exist" cfile:_ -> return cfile where+ isCabal :: String -> Bool isCabal nm = ".cabal" `isSuffixOf` nm && length nm > 6
Distribution/Cab/PkgDB.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} module Distribution.Cab.PkgDB ( -- * Types PkgDB@@ -30,13 +31,21 @@ import Distribution.Simple.Compiler (PackageDB(..)) import Distribution.Simple.GHC (configure, getInstalledPackages, getPackageDBContents) import Distribution.Simple.PackageIndex- (lookupPackageName, lookupSourcePackageId- , allPackages, fromList, reverseDependencyClosure- , topologicalOrder, PackageIndex)+ (lookupPackageName, lookupSourcePackageId, allPackages+ , fromList, reverseDependencyClosure, topologicalOrder)+#if MIN_VERSION_Cabal(1,22,0)+import Distribution.Simple.PackageIndex (InstalledPackageIndex)+#else+import Distribution.Simple.PackageIndex (PackageIndex)+#endif import Distribution.Simple.Program.Db (defaultProgramDb) import Distribution.Verbosity (normal) +#if MIN_VERSION_Cabal(1,22,0)+type PkgDB = InstalledPackageIndex+#else type PkgDB = PackageIndex+#endif type PkgInfo = InstalledPackageInfo ----------------------------------------------------------------@@ -63,12 +72,12 @@ toUserSpec Nothing = UserPackageDB toUserSpec (Just path) = SpecificPackageDB path -getDBs :: [PackageDB] -> IO PackageIndex+getDBs :: [PackageDB] -> IO PkgDB getDBs specs = do (_,_,pro) <- configure normal Nothing Nothing defaultProgramDb getInstalledPackages normal specs pro -getDB :: PackageDB -> IO PackageIndex+getDB :: PackageDB -> IO PkgDB getDB spec = do (_,_,pro) <- configure normal Nothing Nothing defaultProgramDb getPackageDBContents normal spec pro
cab.cabal view
@@ -1,5 +1,5 @@ Name: cab-Version: 0.2.14+Version: 0.2.15 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3@@ -21,7 +21,7 @@ Default-Language: Haskell2010 GHC-Options: -Wall Build-Depends: base >= 4.0 && < 5- , Cabal >= 1.18 && < 1.21+ , Cabal >= 1.18 && < 1.23 , attoparsec >= 0.10 , bytestring , conduit >= 1.1@@ -56,7 +56,7 @@ , containers , directory , filepath- , process >= 1.2.0.0+ , process Other-Modules: Commands Doc Help
src/Run.hs view
@@ -1,8 +1,14 @@+{-# LANGUAGE CPP #-} module Run (run, toSwitch) where import Data.List (intercalate) import Distribution.Cab+#if MIN_VERSION_process(1,2,0) import System.Process (callCommand)+#else+import Control.Monad (void)+import System.Cmd (system)+#endif import Types @@ -55,8 +61,14 @@ options = optionsToString opts sws callProcess :: String -> [String] -> [Arg] -> [String] -> IO ()-callProcess pro args0 args1 options = callCommand script+callProcess pro args0 args1 options = systemCommand script where+#if MIN_VERSION_process(1,2,0)+ systemCommand = callCommand+#else+ systemCommand = void . system+#endif+ script = intercalate " " $ pro : args0 ++ cat args1 ++ options cat [pkg,ver] = [pkg ++ "-" ++ ver] cat x = x