Permalink
Browse files

Merge.hs: added pretty-printer for flag assignment set

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
trofi committed Dec 29, 2013
1 parent a9969bd commit e5f547fbc2476988b7e676b8b254379272e6201f
Showing with 6 additions and 1 deletion.
  1. +6 −1 Merge.hs
View
@@ -191,6 +191,11 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch =
all_possible_flag_assignments :: [Cabal.FlagAssignment]
all_possible_flag_assignments = lflags (Cabal.genPackageFlags pkgGenericDesc)
+ pp_fa :: Cabal.FlagAssignment -> String
+ pp_fa fa = L.intercalate ", " [ (if b then '+' else '-') : f
+ | (Cabal.FlagName f, b) <- fa
+ ]
+
-- key idea is to generate all possible list of flags
deps1 :: [(Cabal.FlagAssignment, Merge.EDep)]
deps1 = [ (f `updateFa` fr, cabal_to_emerge_dep pkgDesc_filtered_bdeps)
@@ -331,7 +336,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch =
notice verbosity $ "Accepted depends: " ++ show (map display accepted_deps)
notice verbosity $ "Skipped depends: " ++ show (map display skipped_deps)
notice verbosity $ "Dropped depends: " ++ show (map display dropped_deps)
- notice verbosity $ "Dead flags: " ++ show deadFlags
+ notice verbosity $ "Dead flags: " ++ show (map pp_fa deadFlags)
notice verbosity $ "Dropped flags: " ++ show (map (unFlagName.fst) commonFlags)
-- mapM_ print tdeps

0 comments on commit e5f547f

Please sign in to comment.