From: Jason Stubbs Date: Sat, 31 Dec 2005 03:58:15 +0000 (-0000) Subject: Unify the -p and -pv USE display functions and IUSE additions in yellow X-Git-Tag: v2.1_pre3~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b1533d34a653617b0e27ae4e70eac9b155bd0520;p=portage.git Unify the -p and -pv USE display functions and IUSE additions in yellow followed by a "%" character. svn path=/main/trunk/; revision=2504 --- diff --git a/bin/emerge b/bin/emerge index 566556c90..a139ffc37 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1489,45 +1489,29 @@ class depgraph: p=[] totalsize=0 - if "--verbose" in myopts: - # Full USE display - def create_use_string(name, cur_iuse, cur_use, old_iuse, old_use, is_new): - usestrs = [] - for flag in cur_iuse: - suffix = "" - if flag in cur_use: - color = red - prefix = "" - else: - color = blue - prefix = "-" - if not is_new and ((flag in old_use) ^ (flag in cur_use)): - color = green - suffix = "*" - usestrs.append(color(prefix+flag)+suffix) - ret = " ".join(usestrs) - if ret: - ret = '%s="%s" ' % (name, ret) - return ret - elif "--quiet" in myopts: - # No USE display + if "--quiet" in myopts: def create_use_string(*args): return "" else: - # Changed-since-previous USE display - def create_use_string(name, cur_iuse, cur_use, old_iuse, old_use, is_new): + def create_use_string(name, cur_iuse, cur_use, old_iuse, old_use, is_new, all_flags=("--verbose" in myopts)): enabled = [] disabled = [] for flag in cur_iuse: - if flag in cur_use and flag not in old_use: - if flag in old_iuse: - enabled.append(green(flag)+"*") - else: + if flag in cur_use: + if is_new or flag in old_use and all_flags: enabled.append(red(flag)) - elif flag not in cur_use and flag in old_use: - disabled.append(green("-"+flag)+"*") - elif is_new or flag not in old_iuse: - disabled.append(blue("-"+flag)) + elif flag not in old_iuse: + enabled.append(yellow(flag)+"%") + elif flag not in old_use: + enabled.append(green(flag)+"*") + else: + if is_new or flag in old_iuse and flag not in old_use and all_flags: + disabled.append(blue("-"+flag)) + elif flag not in old_iuse: + disabled.append(yellow("-"+flag)+"%") + elif flag in old_use: + disabled.append(green("-"+flag)+"*") + enabled = " ".join(enabled) disabled = " ".join(disabled) if enabled and disabled: