commit: f9696bacb5d3feb2a1f7fce75e60ca1c692f37bf
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 10 07:08:43 2014 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 07:08:43 2014 +0000
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=f9696bac
qmerge: fix color used in displaying downgrades
We want to use a darker blue for D status instead of using the same
blue color as U status. This also matches portage behavior.
---
qmerge.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/qmerge.c b/qmerge.c
index 572365e..1e07347 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -357,6 +357,7 @@ qprint_tree_node(int level, const depend_atom *atom, const
struct pkg_t *pkg)
char install_ver[126] = "";
char c = 'N';
+ const char *color;
if (!pretend)
return 0;
@@ -385,10 +386,13 @@ qprint_tree_node(int level, const depend_atom *atom,
const struct pkg_t *pkg)
return c;
if ((c == 'R' || c == 'D') && update_only && level)
return c;
- if (c == 'R')
- snprintf(buf, sizeof(buf), "%s%c%s", YELLOW, c, NORM);
- if (c == 'U' || c == 'D')
- snprintf(buf, sizeof(buf), "%s%c%s", BLUE, c, NORM);
+ switch (c) {
+ case 'R': color = YELLOW; break;
+ case 'U': color = BLUE; break;
+ case 'D': color = DKBLUE; break;
+ default: color = RED; break;
+ }
+ snprintf(buf, sizeof(buf), "%s%c%s", color, c, NORM);
#if 0
if (level) {
switch (c) {