aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-05 10:42:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-05 10:42:56 +0000
commit6086e49a1d56a1d67e7318005a7bfb40366411b0 (patch)
tree2aee1989ef4b1a7ffa1272e69b217b925c1a97ae
parentf4bd253b5f5b4d4dd0df28143edeb26e654eb9a1 (diff)
downloadpaludis-6086e49a1d56a1d67e7318005a7bfb40366411b0.tar.gz
paludis-6086e49a1d56a1d67e7318005a7bfb40366411b0.tar.xz
Fix show-use-descriptions for new packages. Fixes: ticket:427
-rw-r--r--NEWS1
-rw-r--r--src/output/colour_formatter.cc20
-rw-r--r--src/output/colour_formatter.hh2
-rw-r--r--src/output/console_install_task.cc6
4 files changed, 24 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 00d2989..afc08eb 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ trunk/:
* Bug fixes: --dl-deps-default works again. More
robustness/compilance improvements for reconcilio, including
proper handling of ELF files that use the non-native byte order.
+ --show-use-descriptions works as in 0.24 for new packages.
0.26.0_alpha2:
* STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
diff --git a/src/output/colour_formatter.cc b/src/output/colour_formatter.cc
index 6371cdd..43de8aa 100644
--- a/src/output/colour_formatter.cc
+++ b/src/output/colour_formatter.cc
@@ -31,6 +31,8 @@ namespace paludis
template <>
struct Implementation<ColourFormatter>
{
+ const bool unchanged_are_new;
+
mutable std::string active_prefix;
const tr1::shared_ptr<UseFlagNameSet> seen_new_use_flag_names;
@@ -38,7 +40,8 @@ namespace paludis
const tr1::shared_ptr<UseFlagNameSet> seen_use_flag_names;
const tr1::shared_ptr<UseFlagNameSet> seen_use_expand_prefixes;
- Implementation() :
+ Implementation(const bool b) :
+ unchanged_are_new(b),
seen_new_use_flag_names(new UseFlagNameSet),
seen_changed_use_flag_names(new UseFlagNameSet),
seen_use_flag_names(new UseFlagNameSet),
@@ -48,8 +51,8 @@ namespace paludis
};
}
-ColourFormatter::ColourFormatter() :
- PrivateImplementationPattern<ColourFormatter>(new Implementation<ColourFormatter>)
+ColourFormatter::ColourFormatter(const bool b) :
+ PrivateImplementationPattern<ColourFormatter>(new Implementation<ColourFormatter>(b))
{
}
@@ -85,6 +88,9 @@ std::string
ColourFormatter::format(const IUseFlag & f, const format::Plain &) const
{
_imp->seen_use_flag_names->insert(f.flag);
+ if (_imp->unchanged_are_new)
+ _imp->seen_new_use_flag_names->insert(f.flag);
+
std::string g(stringify(f.flag)), h;
if (std::string::npos != f.prefix_delim_pos)
@@ -108,6 +114,8 @@ std::string
ColourFormatter::format(const IUseFlag & f, const format::Enabled &) const
{
_imp->seen_use_flag_names->insert(f.flag);
+ if (_imp->unchanged_are_new)
+ _imp->seen_new_use_flag_names->insert(f.flag);
std::string g(stringify(f.flag)), h;
if (std::string::npos != f.prefix_delim_pos)
@@ -131,6 +139,8 @@ std::string
ColourFormatter::format(const IUseFlag & f, const format::Disabled &) const
{
_imp->seen_use_flag_names->insert(f.flag);
+ if (_imp->unchanged_are_new)
+ _imp->seen_new_use_flag_names->insert(f.flag);
std::string g(stringify(f.flag)), h;
if (std::string::npos != f.prefix_delim_pos)
@@ -154,6 +164,8 @@ std::string
ColourFormatter::format(const IUseFlag & f, const format::Forced &) const
{
_imp->seen_use_flag_names->insert(f.flag);
+ if (_imp->unchanged_are_new)
+ _imp->seen_new_use_flag_names->insert(f.flag);
std::string g(stringify(f.flag)), h;
if (std::string::npos != f.prefix_delim_pos)
@@ -177,6 +189,8 @@ std::string
ColourFormatter::format(const IUseFlag & f, const format::Masked &) const
{
_imp->seen_use_flag_names->insert(f.flag);
+ if (_imp->unchanged_are_new)
+ _imp->seen_new_use_flag_names->insert(f.flag);
std::string g(stringify(f.flag)), h;
if (std::string::npos != f.prefix_delim_pos)
diff --git a/src/output/colour_formatter.hh b/src/output/colour_formatter.hh
index 7554836..74a4465 100644
--- a/src/output/colour_formatter.hh
+++ b/src/output/colour_formatter.hh
@@ -45,7 +45,7 @@ class ColourFormatter :
private paludis::PrivateImplementationPattern<ColourFormatter>
{
public:
- ColourFormatter();
+ ColourFormatter(const bool unchanged_are_new = false);
~ColourFormatter();
const paludis::tr1::shared_ptr<const paludis::UseFlagNameSet> seen_new_use_flag_names() const;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 1347eac..9920172 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1081,7 +1081,6 @@ ConsoleInstallTask::display_merge_list_entry_use(const DepListEntry & d,
return;
output_no_endl(" ");
- ColourFormatter formatter;
tr1::shared_ptr<const PackageID> old_id;
if (! existing_slot_repo->empty())
@@ -1089,12 +1088,17 @@ ConsoleInstallTask::display_merge_list_entry_use(const DepListEntry & d,
else if (! existing_repo->empty())
old_id = *existing_repo->last();
+ ColourFormatter formatter(old_id ? false : true);
if (d.package_id->iuse_key())
{
if (old_id)
+ {
output_stream() << d.package_id->iuse_key()->pretty_print_flat_with_comparison(environment(), old_id, formatter);
+ }
else
+ {
output_stream() << d.package_id->iuse_key()->pretty_print_flat(formatter);
+ }
}
_add_descriptions(formatter.seen_new_use_flag_names(), d.package_id, uds_new);