Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge.hs: cleanup: move optimizer code to separate helper

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
commit de938f3908a3f15cd5887928d341294ebb212e94 1 parent 2b5c12a
Sergei Trofimovich trofi authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 Merge.hs
7 Merge.hs
View
@@ -226,10 +226,13 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch =
-- flags that are failed to resolve
deadFlags = filter (\x -> all (x/=) $ map fst deps1) all_possible_flag_assignments
-- and finally prettify all deps:
+ optimize_fa_depends :: [([(Cabal.FlagName, Bool)], [Portage.Dependency])] -> [Portage.Dependency]
+ optimize_fa_depends deps = Portage.sortDeps . simplify $ map (\x -> (x,[])) $ map (first (filter (\x -> all (x/=) commonFlags))) deps
+
tdeps :: Merge.EDep
tdeps = (L.foldl' (\x y -> x `mappend` (snd y)) mempty deps1){
- Merge.dep = Portage.sortDeps . simplify $ map (\x -> (x,[])) $ map (first (filter (\x -> all (x/=) commonFlags))) $ map (second Merge.dep) deps1
- , Merge.rdep = Portage.sortDeps . simplify $ map (\x -> (x,[])) $ map (first (filter (\x -> all (x/=) commonFlags))) $ map (second Merge.rdep) deps1
+ Merge.dep = optimize_fa_depends $ map (second Merge.dep) deps1
+ , Merge.rdep = optimize_fa_depends $ map (second Merge.rdep) deps1
}
common :: [FlagDepH] -> FlagDepH
Please sign in to comment.
Something went wrong with that request. Please try again.