haskell-updater 1.2.1 → 1.2.3
raw patch · 6 files changed
+38/−42 lines, 6 filesdep ~Cabaldep ~bytestringdep ~containers
Dependency ranges changed: Cabal, bytestring, containers, directory, filepath, process
Files
- Distribution/Gentoo/GHC.hs +6/−9
- Distribution/Gentoo/Packages.hs +2/−2
- Distribution/Gentoo/PkgManager.hs +2/−2
- Distribution/Gentoo/Util.hs +5/−4
- Main.hs +5/−5
- haskell-updater.cabal +18/−20
Distribution/Gentoo/GHC.hs view
@@ -119,7 +119,7 @@ -- Add this .conf file to the Map addConf :: ConfMap -> FilePath -> IO ConfMap addConf cmp conf = do cnts <- BS.unpack `fmap` BS.readFile conf- case (reads cnts) of+ case reads cnts of [] -> return cmp -- ebuilds that have CABAL_CORE_LIB_GHC_PV set -- for this version of GHC will have a .conf@@ -135,7 +135,7 @@ checkPkgs :: Verbosity -> ([PackageIdentifier], [FilePath]) -> IO ([Package],[PackageIdentifier],[FilePath])-checkPkgs v (pns,cnfs)+checkPkgs _v (pns,cnfs) = do pkgs <- haveFiles cnfs return (pkgs, pns, []) @@ -150,9 +150,7 @@ -- It would be nice to do this, but we can't assume -- some crazy user hasn't deleted one of these dirs -- libFronts' <- filterM doesDirectoryExist libFronts- pkgs <- liftM notGHC- $ checkLibDirs v thisGhc' libFronts- return pkgs+ liftM notGHC $ checkLibDirs v thisGhc' libFronts -- Find packages installed by other versions of GHC in this possible -- library directory.@@ -163,7 +161,7 @@ where wanted dir = isValid dir && (not . isInvalid) dir - isValid dir = any (\ldir -> isGhcLibDir ldir dir) libDirs+ isValid dir = any (`isGhcLibDir` dir) libDirs -- Invalid if it's this GHC isInvalid fp = fp == thisGhc || BS.isPrefixOf (thisGhc `BS.snoc` pathSeparator) fp@@ -222,6 +220,5 @@ allInstalledPackages :: IO [Package] allInstalledPackages = do libDir <- ghcLibDir let libDir' = BS.pack libDir- pkgs <- liftM notGHC- $ pkgsHaveContent $ hasDirMatching (==libDir')- return pkgs+ liftM notGHC $ pkgsHaveContent+ $ hasDirMatching (==libDir')
Distribution/Gentoo/Packages.hs view
@@ -59,7 +59,7 @@ -- Return all packages that are not a version of GHC. notGHC :: [Package] -> [Package]-notGHC = filter (\p -> isNot ghcPkg p)+notGHC = filter (isNot ghcPkg) where isNot p1 = not . samePackageAs p1 @@ -182,7 +182,7 @@ haveFiles fps = pkgsHaveContent p where fps' = S.fromList $ map BS.pack fps- p = hasObjMatching (\fp -> S.member fp fps')+ p = hasObjMatching (`S.member` fps') -- Find which packages have Content information that matches the -- provided predicate; to be used with the searching predicates
Distribution/Gentoo/PkgManager.hs view
@@ -43,7 +43,7 @@ -- defined, if it is unknown then it won't be used. defaultPM :: IO PkgManager defaultPM = do eDPM <- lookup "PACKAGE_MANAGER" `fmap` getEnvironment- let dPM = maybe defaultPMName id eDPM+ let dPM = fromMaybe defaultPMName eDPM mPM = dPM `M.lookup` pmNameMap return $ fromMaybe knownDef mPM where@@ -77,7 +77,7 @@ -- | Choose the appropriate PM from the textual representation; throws -- an error if that PM isn't known. choosePM :: String -> PkgManager-choosePM pm = maybe (InvalidPM pm) id $ pm' `M.lookup` pmNameMap+choosePM pm = fromMaybe (InvalidPM pm) $ pm' `M.lookup` pmNameMap where pm' = map toLower pm
Distribution/Gentoo/Util.hs view
@@ -13,7 +13,7 @@ , getDirectoryContents' ) where -import Data.List(groupBy)+import qualified Data.List as L import Data.ByteString.Char8(ByteString) import System.Directory(getDirectoryContents) import Control.Monad(liftM)@@ -25,9 +25,10 @@ concatMapM f = liftM concat . mapM f breakAll :: (a -> Bool) -> [a] -> [[a]]-breakAll p = groupBy (const (not . p))+breakAll p = L.groupBy (const (not . p)) -- Don't return . or .. getDirectoryContents' :: FilePath -> IO [FilePath]-getDirectoryContents' dir = do is <- getDirectoryContents dir- return $ filter (`notElem` [".", ".."]) is+getDirectoryContents' dir = do+ is <- getDirectoryContents dir+ return $ filter (`notElem` [".", ".."]) $ L.sort is
Main.hs view
@@ -23,7 +23,7 @@ import qualified Paths_haskell_updater as Paths(version) import System.Console.GetOpt import System.Environment(getArgs, getProgName)-import System.Exit(ExitCode(..), exitWith)+import System.Exit(ExitCode(..), exitSuccess, exitWith) import System.IO(hPutStrLn, stderr) import Control.Monad(liftM, unless) import System.Process(rawSystem)@@ -62,7 +62,7 @@ -- Note that it's safe (at the moment at least) to assume that when -- the lower of one is a Build that they're both build. combineActions :: Action -> Action -> Action-combineActions a1 a2 = case (a1 `min` a2) of+combineActions a1 a2 = case a1 `min` a2 of Help -> Help Version -> Version Build{} -> Build $ targets a1 `Set.union` targets a2@@ -143,7 +143,7 @@ runCmd :: WithCmd -> String -> [String] -> IO a runCmd mode cmd args = case mode of RunOnly -> runCommand cmd args- PrintOnly -> putStrLn cmd_line >> exitWith (ExitSuccess)+ PrintOnly -> putStrLn cmd_line >> exitSuccess PrintAndRun -> putStrLn cmd_line >> runCommand cmd args where cmd_line = unwords (cmd:args) @@ -250,7 +250,7 @@ "Print this help message." ] where- pmList = unlines . map ((++) " * ") $ definedPMs+ pmList = unlines . map (" * " ++) $ definedPMs defPM = "The last valid value of PM specified is chosen.\n\ \The default package manager is: " ++ defaultPMName ++ ",\n\ \which can be overriden with the \"PACKAGE_MANAGER\"\n\@@ -297,7 +297,7 @@ success :: Verbosity -> String -> IO a success v msg = do say v msg- exitWith ExitSuccess+ exitSuccess die :: String -> IO a die msg = do putErrLn ("ERROR: " ++ msg)
haskell-updater.cabal view
@@ -1,6 +1,6 @@ Name: haskell-updater Homepage: http://haskell.org/haskellwiki/Gentoo#haskell-updater-Version: 1.2.1+Version: 1.2.3 Synopsis: Rebuild Haskell dependencies in Gentoo Description: haskell-updater rebuilds Haskell packages on Gentoo after a GHC upgrade or a dependency upgrade.@@ -33,23 +33,21 @@ Type: git Location: git://github.com/gentoo-haskell/haskell-updater.git -Executable haskell-updater {-- Main-Is: Main.hs- Other-Modules: Distribution.Gentoo.GHC,- Distribution.Gentoo.Packages,- Distribution.Gentoo.PkgManager,- Distribution.Gentoo.Util,- Output,- Paths_haskell_updater- Ghc-Options: -Wall- Ghc-Prof-Options: -auto-all -caf-all -rtsopts+Executable haskell-updater+ Main-Is: Main.hs+ Other-Modules: Distribution.Gentoo.GHC,+ Distribution.Gentoo.Packages,+ Distribution.Gentoo.PkgManager,+ Distribution.Gentoo.Util,+ Output,+ Paths_haskell_updater+ Ghc-Options: -Wall+ Ghc-Prof-Options: -auto-all -caf-all -rtsopts - Build-Depends: base == 4.*,- Cabal >= 1.8 && < 1.19,- containers < 0.6,- filepath < 1.4,- directory < 1.3,- bytestring < 1.0,- process < 1.2-}+ Build-Depends: base >= 4 && < 5,+ Cabal >= 1.8,+ containers,+ filepath,+ directory,+ bytestring,+ process