For bug #186826, always show --newuse flags that trigger reinstallation even when...
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Jul 2007 22:03:31 +0000 (22:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Jul 2007 22:03:31 +0000 (22:03 -0000)
svn path=/main/branches/2.1.2/; revision=7408

bin/emerge

index 95762b7a786d827f40fe66731d07679edea3760d..5c5f3aa25e50741ddceb5a7dd3028c6c3df76ca8 100755 (executable)
@@ -2586,7 +2586,8 @@ class depgraph:
                else:
                        def create_use_string(name, cur_iuse, iuse_forced, cur_use,
                                old_iuse, old_use,
-                               is_new, all_flags=(verbosity == 3 or "--quiet" in self.myopts),
+                               is_new, reinst_flags,
+                               all_flags=(verbosity == 3 or "--quiet" in self.myopts),
                                alphabetical=("--alphabetical" in self.myopts)):
                                enabled = []
                                if alphabetical:
@@ -2604,16 +2605,18 @@ class depgraph:
                                for flag in any_iuse:
                                        flag_str = None
                                        isEnabled = False
+                                       reinst_flag = reinst_flags and flag in reinst_flags
                                        if flag in enabled_flags:
                                                isEnabled = True
-                                               if is_new or flag in old_use and all_flags:
+                                               if is_new or flag in old_use and \
+                                                       (all_flags or reinst_flag):
                                                        flag_str = red(flag)
                                                elif flag not in old_iuse:
                                                        flag_str = yellow(flag) + "%*"
                                                elif flag not in old_use:
                                                        flag_str = green(flag) + "*"
                                        elif flag in removed_iuse:
-                                               if all_flags:
+                                               if all_flags or reinst_flag:
                                                        flag_str = yellow("-" + flag) + "%"
                                                        if flag in old_use:
                                                                flag_str += "*"
@@ -2621,7 +2624,9 @@ class depgraph:
                                                        removed.append(flag_str)
                                                continue
                                        else:
-                                               if is_new or flag in old_iuse and flag not in old_use and all_flags:
+                                               if is_new or flag in old_iuse and \
+                                                       flag not in old_use and \
+                                                       (all_flags or reinst_flag):
                                                        flag_str = blue("-" + flag)
                                                elif flag not in old_iuse:
                                                        flag_str = yellow("-" + flag)
@@ -2932,22 +2937,24 @@ class depgraph:
 
                                        # Prevent USE_EXPAND_HIDDEN flags from being hidden if they
                                        # are the only thing that triggered reinstallation.
-                                       reinst_flags_map = None
+                                       reinst_flags_map = {}
                                        reinstall_for_flags = self._reinstall_nodes.get(pkg_node)
+                                       reinst_expand_map = None
                                        if reinstall_for_flags:
                                                reinst_flags_map = map_to_use_expand(
                                                        list(reinstall_for_flags), removeHidden=False)
-                                               if reinst_flags_map["USE"]:
-                                                       reinst_flags_map = None
-                                               else:
-                                                       for k in reinst_flags_map.keys():
-                                                               if not reinst_flags_map[k]:
-                                                                       del reinst_flags_map[k]
-                                       if reinst_flags_map and \
-                                               not set(reinst_flags_map).difference(
+                                               for k in list(reinst_flags_map):
+                                                       if not reinst_flags_map[k]:
+                                                               del reinst_flags_map[k]
+                                               if not reinst_flags_map.get("USE"):
+                                                       reinst_expand_map = reinst_flags_map.copy()
+                                                       reinst_expand_map.pop("USE", None)
+                                       if reinst_expand_map and \
+                                               not set(reinst_expand_map).difference(
                                                use_expand_hidden):
-                                               use_expand_hidden = set(use_expand_hidden).difference(
-                                                       reinst_flags_map)
+                                               use_expand_hidden = \
+                                                       set(use_expand_hidden).difference(
+                                                       reinst_expand_map)
 
                                        cur_iuse_map, iuse_forced = \
                                                map_to_use_expand(cur_iuse, forcedFlags=True)
@@ -2964,7 +2971,8 @@ class depgraph:
                                                verboseadd += create_use_string(key.upper(),
                                                        cur_iuse_map[key], iuse_forced[key],
                                                        cur_use_map[key], old_iuse_map[key],
-                                                       old_use_map[key], is_new)
+                                                       old_use_map[key], is_new,
+                                                       reinst_flags_map.get(key))
 
                                if verbosity == 3:
                                        # size verbose