cab 0.2.11 → 0.2.12
raw patch · 7 files changed
+30/−12 lines, 7 filesdep ~processPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: process
API changes (from Hackage documentation)
+ Distribution.Cab: OptFuture :: Option
+ Distribution.Cab.Version: instance Ord Ver
+ Distribution.Cab.Version: instance Read Ver
Files
- Distribution/Cab/Commands.hs +12/−2
- Distribution/Cab/Version.hs +1/−1
- cab.cabal +4/−2
- src/Commands.hs +5/−3
- src/Options.hs +4/−1
- src/Run.hs +3/−3
- src/Types.hs +1/−0
Distribution/Cab/Commands.hs view
@@ -40,6 +40,7 @@ | OptJobs String | OptImport String | OptStatic+ | OptFuture deriving (Eq,Show) ----------------------------------------------------------------@@ -77,8 +78,17 @@ verDB <- toMap <$> getVerDB InstalledOnly forM_ pkgs $ \p -> case M.lookup (nameOfPkgInfo p) verDB of Nothing -> return ()- Just ver -> when (verOfPkgInfo p /= ver) $- putStrLn $ fullNameOfPkgInfo p ++ " /= " ++ verToString ver+ Just ver -> do+ let comp = verOfPkgInfo p `compare` ver+ when (dated comp) $+ putStrLn $ fullNameOfPkgInfo p ++ (showIneq comp) ++ verToString ver+ where+ dated LT = True+ dated GT = OptFuture `elem` opts+ dated EQ = False+ showIneq LT = " < "+ showIneq GT = " > "+ showIneq EQ = error "Packages have equal versions" getDB :: [Option] -> IO PkgDB getDB opts
Distribution/Cab/Version.hs view
@@ -10,7 +10,7 @@ import Distribution.Version (Version(..)) -- | Package version.-newtype Ver = Ver [Int] deriving (Eq,Show)+newtype Ver = Ver [Int] deriving (Eq,Ord,Read,Show) -- | Creating 'Ver'. --
cab.cabal view
@@ -1,5 +1,5 @@ Name: cab-Version: 0.2.11+Version: 0.2.12 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3@@ -45,6 +45,8 @@ Default-Language: Haskell2010 Main-Is: Main.hs GHC-Options: -Wall+ if os(windows)+ GHC-Options: -threaded HS-Source-Dirs: src Build-Depends: base >= 4.0 && < 5 , cab@@ -56,7 +58,7 @@ , containers , directory , filepath- , process+ , process >= 1.2.0.0 Other-Modules: Commands Doc Help
src/Commands.hs view
@@ -89,7 +89,9 @@ , commandNames = ["outdated"] , document = "Display outdated packages" , routing = RouteFunc outdated- , switches = [(SwAll, None)]+ , switches = [(SwAll, None)+ ,(SwFuture, Solo "--future")+ ] , manual = Nothing } , CommandSpec {@@ -118,9 +120,9 @@ } , CommandSpec { command = Unpack- , commandNames = ["unpack"]+ , commandNames = ["get", "unpack"] , document = "Untar a package in the current directory"- , routing = RouteCabal ["unpack"]+ , routing = RouteCabal ["get"] , switches = [] , manual = Just "<package> [<ver>]" }
src/Options.hs view
@@ -48,10 +48,13 @@ , Option ['s'] ["static"] (NoArg OptStatic) "Create static libraries only"+ , Option ['u'] ["future"]+ (NoArg OptFuture)+ "Show packages with versions ahead of Hackage" , Option ['h'] ["help"] (NoArg OptHelp) "Show help message" ] optionDB :: OptionDB-optionDB = zip [SwNoharm,SwRecursive,SwAll,SwInfo,SwFlag,SwTest,SwBench,SwDepsOnly,SwLibProfile,SwExecProfile,SwJobs,SwImport,SwStatic] getOptDB+optionDB = zip [SwNoharm,SwRecursive,SwAll,SwInfo,SwFlag,SwTest,SwBench,SwDepsOnly,SwLibProfile,SwExecProfile,SwJobs,SwImport,SwStatic,SwFuture] getOptDB
src/Run.hs view
@@ -1,9 +1,8 @@ module Run (run, toSwitch) where -import Control.Monad (void) import Data.List (intercalate) import Distribution.Cab-import System.Cmd (system)+import System.Process (callCommand) import Types @@ -23,6 +22,7 @@ toSwitch (OptJobs _) = SwJobs toSwitch (OptImport _) = SwImport toSwitch OptStatic = SwStatic+toSwitch OptFuture = SwFuture toSwitch _ = error "toSwitch" ----------------------------------------------------------------@@ -55,7 +55,7 @@ options = optionsToString opts sws callProcess :: String -> [String] -> [Arg] -> [String] -> IO ()-callProcess pro args0 args1 options = void . system $ script+callProcess pro args0 args1 options = callCommand script where script = intercalate " " $ pro : args0 ++ cat args1 ++ options cat [pkg,ver] = [pkg ++ "-" ++ ver]
src/Types.hs view
@@ -22,6 +22,7 @@ | SwJobs | SwImport | SwStatic+ | SwFuture deriving (Eq,Show) ----------------------------------------------------------------