Commit 163267f5 authored by bjorn@bringert.net's avatar bjorn@bringert.net
Browse files

Some minor refactoring.n

parent 2e1365be
......@@ -62,13 +62,9 @@ import Network.Hackage.CabalInstall.Types (ConfigFlags (..), PkgInfo (..), Repo(
import Network.Hackage.CabalInstall.Utils
-- |Name of the packages directory.
packagesDirectoryName :: FilePath
packagesDirectoryName = "packages"
-- | Full path to the packages directory.
packagesDirectory :: ConfigFlags -> FilePath
packagesDirectory cfg = configCacheDir cfg </> packagesDirectoryName
packagesDirectory cfg = configCacheDir cfg </> "packages"
-- | Full path to the local cache directory for a repository.
repoCacheDir :: ConfigFlags -> Repo -> FilePath
......
......@@ -149,9 +149,7 @@ getPackages = map worker
-- |List all packages which can be fetched.
filterFetchables :: [ResolvedPackage] -> [(PackageIdentifier,Repo)]
filterFetchables = mapMaybe worker
where worker dep = do (pkg,repo,_) <- resolvedData dep
return (pkg,repo)
filterFetchables pkgs = [(pkg,repo) | Just (pkg,repo,_) <- map resolvedData pkgs]
finalizePackage :: Compiler
-> [PackageIdentifier] -- ^ All installed packages
......@@ -188,7 +186,7 @@ resolveDependenciesAux cfg ps deps
Nothing -> resolvedDepToResolvedPkg (dependency dep,Nothing)
_ -> rDep
return $ map resolve (filter (not . isInstalled ps . dependency) deps)
where
-- |Resolve some dependencies from the known packages while filtering out installed packages.
-- The result has been modified to put the dependencies in front of the packages.
resolveDependencies :: ConfigFlags
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment