aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-27 15:01:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-27 15:24:34 +0000
commit93287f57ae8568378fe94d22a23cd53293a12a62 (patch)
treeafe33b879f52f5115fee2a8847efeef14894fd3f
parent8d1a9e84c802dd33e8fd2829563bf34788a7a682 (diff)
downloadpaludis-93287f57ae8568378fe94d22a23cd53293a12a62.tar.gz
paludis-93287f57ae8568378fe94d22a23cd53293a12a62.tar.xz
Don't show einfo when it's spam
-rw-r--r--paludis/distributions/exherbo/paludis.conf1
-rw-r--r--paludis/distributions/gentoo/paludis.conf1
-rw-r--r--paludis/environments/paludis/default_output.conf20
-rw-r--r--paludis/environments/paludis/extra_distribution_data.cc3
-rw-r--r--paludis/environments/paludis/extra_distribution_data.hh4
-rw-r--r--paludis/environments/paludis/output_conf.cc23
6 files changed, 45 insertions, 7 deletions
diff --git a/paludis/distributions/exherbo/paludis.conf b/paludis/distributions/exherbo/paludis.conf
index be3b043..4506ae8 100644
--- a/paludis/distributions/exherbo/paludis.conf
+++ b/paludis/distributions/exherbo/paludis.conf
@@ -1,4 +1,5 @@
bashrc_filename = bashrc
+info_messages_are_spam = false
keywords_filename_part = platforms
licenses_filename_part = licences
mandatory_userpriv = true
diff --git a/paludis/distributions/gentoo/paludis.conf b/paludis/distributions/gentoo/paludis.conf
index 0c270f4..db707ed 100644
--- a/paludis/distributions/gentoo/paludis.conf
+++ b/paludis/distributions/gentoo/paludis.conf
@@ -1,4 +1,5 @@
bashrc_filename = bashrc
+info_messages_are_spam = true
keywords_filename_part = keywords
licenses_filename_part = licenses
mandatory_userpriv = false
diff --git a/paludis/environments/paludis/default_output.conf b/paludis/environments/paludis/default_output.conf
index a5862fa..f6c728a 100644
--- a/paludis/environments/paludis/default_output.conf
+++ b/paludis/environments/paludis/default_output.conf
@@ -151,8 +151,16 @@ if_false = null
if_unset = null
# format_important_log_messages_at_end has decided we support summaries, so show
-# log messages at the end:
+# log messages at the end. we may or may not want to show info messages too.
[manager format_important_log_messages_at_end_supported]
+handler = conditional_alias
+condition_variable = info_messages_are_spam
+if_true = format_important_log_messages_at_end_supported_without_info
+if_false = format_important_log_messages_at_end_supported_with_info
+if_unset = null
+
+# format_important_log_messages_at_end, and einfo is not useless spam:
+[manager format_important_log_messages_at_end_supported_with_info]
handler = format_messages
format_debug =
format_info = "%{green}***%{normal} %{message}%{newline}"
@@ -161,6 +169,16 @@ format_error =
format_log = "%{blue}***%{normal} %{message}%{newline}"
child = important_log_messages_at_end
+# format_important_log_messages_at_end, and einfo is useless spam:
+[manager format_important_log_messages_at_end_supported_without_info]
+handler = format_messages
+format_debug =
+format_info =
+format_warn =
+format_error =
+format_log = "%{blue}***%{normal} %{message}%{newline}"
+child = important_log_messages_at_end
+
# At the end, we forward stored important log messages to standard output:
[manager important_log_messages_at_end]
handler = forward_at_finish
diff --git a/paludis/environments/paludis/extra_distribution_data.cc b/paludis/environments/paludis/extra_distribution_data.cc
index 0893c63..dc27afe 100644
--- a/paludis/environments/paludis/extra_distribution_data.cc
+++ b/paludis/environments/paludis/extra_distribution_data.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -40,6 +40,7 @@ namespace paludis
{
return make_shared_ptr(new PaludisDistribution(make_named_values<PaludisDistribution>(
value_for<n::bashrc_filename>(k->get("bashrc_filename")),
+ value_for<n::info_messages_are_spam>(destringify<bool>(k->get("info_messages_are_spam"))),
value_for<n::keywords_filename_part>(k->get("keywords_filename_part")),
value_for<n::licenses_filename_part>(k->get("licenses_filename_part")),
value_for<n::mandatory_userpriv>(destringify<bool>(k->get("mandatory_userpriv"))),
diff --git a/paludis/environments/paludis/extra_distribution_data.hh b/paludis/environments/paludis/extra_distribution_data.hh
index 0496e5d..34b2217 100644
--- a/paludis/environments/paludis/extra_distribution_data.hh
+++ b/paludis/environments/paludis/extra_distribution_data.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -29,6 +29,7 @@ namespace paludis
namespace n
{
struct bashrc_filename;
+ struct info_messages_are_spam;
struct keywords_filename_part;
struct licenses_filename_part;
struct mandatory_userpriv;
@@ -47,6 +48,7 @@ namespace paludis
struct PaludisDistribution
{
NamedValue<n::bashrc_filename, std::string> bashrc_filename;
+ NamedValue<n::info_messages_are_spam, bool> info_messages_are_spam;
NamedValue<n::keywords_filename_part, std::string> keywords_filename_part;
NamedValue<n::licenses_filename_part, std::string> licenses_filename_part;
NamedValue<n::mandatory_userpriv, bool> mandatory_userpriv;
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index d41aa95..44bed42 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -21,6 +21,7 @@
#include <paludis/environments/paludis/bashable_conf.hh>
#include <paludis/environments/paludis/paludis_config.hh>
#include <paludis/environments/paludis/paludis_environment.hh>
+#include <paludis/environments/paludis/extra_distribution_data.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
@@ -42,6 +43,7 @@
#include <paludis/action.hh>
#include <paludis/output_manager_factory.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/distribution.hh>
#include <list>
#include <vector>
#include <map>
@@ -223,9 +225,13 @@ namespace
struct CreateVarsFromInfo
{
+ const Environment * const env;
std::tr1::shared_ptr<Map<std::string, std::string> > m;
- CreateVarsFromInfo(std::tr1::shared_ptr<Map<std::string, std::string> > & mm) :
+ CreateVarsFromInfo(
+ const Environment * const e,
+ std::tr1::shared_ptr<Map<std::string, std::string> > & mm) :
+ env(e),
m(mm)
{
/* convenience, for everyone */
@@ -237,6 +243,12 @@ namespace
m->insert("normal", "\033[0;0m");
m->insert("time", stringify(time(0)));
m->insert("pid", stringify(getpid()));
+
+ const std::tr1::shared_ptr<const PaludisDistribution> dist(
+ PaludisExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(env->distribution())));
+
+ m->insert("info_messages_are_spam", stringify(dist->info_messages_are_spam()));
}
void visit(const CreateOutputManagerForRepositorySyncInfo & i)
@@ -266,10 +278,12 @@ namespace
};
const std::tr1::shared_ptr<Map<std::string, std::string> >
- vars_from_create_output_manager_info(const CreateOutputManagerInfo & i)
+ vars_from_create_output_manager_info(
+ const Environment * const env,
+ const CreateOutputManagerInfo & i)
{
std::tr1::shared_ptr<Map<std::string, std::string> > result(new Map<std::string, std::string>);
- CreateVarsFromInfo v(result);
+ CreateVarsFromInfo v(env, result);
i.accept(v);
return result;
}
@@ -407,7 +421,8 @@ OutputConf::create_named_output_manager(const std::string & s, const CreateOutpu
if (i == _imp->managers.end())
throw PaludisConfigError("No output manager named '" + s + "' exists");
- std::tr1::shared_ptr<Map<std::string, std::string> > vars(vars_from_create_output_manager_info(n));
+ std::tr1::shared_ptr<Map<std::string, std::string> > vars(vars_from_create_output_manager_info(
+ _imp->env, n));
std::string handler;
if (i->second->end() != i->second->find("handler"))