aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments/paludis
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/environments/paludis')
-rw-r--r--paludis/environments/paludis/default_output.conf4
-rw-r--r--paludis/environments/paludis/output_conf.cc19
-rw-r--r--paludis/environments/paludis/output_managers/Makefile.am1
-rw-r--r--paludis/environments/paludis/output_managers/standard_on_failure.conf6
4 files changed, 30 insertions, 0 deletions
diff --git a/paludis/environments/paludis/default_output.conf b/paludis/environments/paludis/default_output.conf
index 21ab224..863880e 100644
--- a/paludis/environments/paludis/default_output.conf
+++ b/paludis/environments/paludis/default_output.conf
@@ -13,3 +13,7 @@ type = * output_exclusivity = background : quiet
type = package action = pretend : standard
+# We only want to show pretend-time fetch verification if it failed.
+
+type = package action = fetch ignore_unfetched = true : standard_on_failure
+
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index feee537..5b30b47 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -32,6 +32,8 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_shared_copy.hh>
+#include <paludis/util/tribool.hh>
+#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/create_output_manager_info.hh>
#include <paludis/package_id.hh>
@@ -48,6 +50,7 @@ namespace paludis
namespace n
{
struct action_requirement;
+ struct ignore_unfetched_requirement;
struct manager;
struct matches_requirement;
struct name_requirement;
@@ -61,6 +64,7 @@ namespace
struct Rule
{
NamedValue<n::action_requirement, std::string> action_requirement;
+ NamedValue<n::ignore_unfetched_requirement, Tribool> ignore_unfetched_requirement;
NamedValue<n::manager, std::string> manager;
NamedValue<n::matches_requirement, std::tr1::shared_ptr<PackageDepSpec> > matches_requirement;
NamedValue<n::name_requirement, std::string> name_requirement;
@@ -110,6 +114,8 @@ namespace
v, env, UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation));
else if (k == "action")
rule.action_requirement() = v;
+ else if (k == "ignore_unfetched")
+ rule.ignore_unfetched_requirement() = destringify<Tribool>(v);
else
throw PaludisConfigError("Unknown rule '" + k + "'");
}
@@ -143,6 +149,9 @@ namespace
if (rule.matches_requirement())
return false;
+ if (! rule.ignore_unfetched_requirement().is_indeterminate())
+ return false;
+
return true;
}
@@ -165,6 +174,15 @@ namespace
*i.package_id(), MatchPackageOptions()))
return false;
+ if (! rule.ignore_unfetched_requirement().is_indeterminate())
+ {
+ const FetchAction * const fetch_action(simple_visitor_cast<const FetchAction>(i.action()));
+ if (! fetch_action)
+ return false;
+ if (fetch_action->options.ignore_unfetched() != rule.ignore_unfetched_requirement().is_true())
+ return false;
+ }
+
return true;
}
};
@@ -205,6 +223,7 @@ OutputConf::add(const FSEntry & filename)
Rule rule(make_named_values<Rule>(
value_for<n::action_requirement>("*"),
+ value_for<n::ignore_unfetched_requirement>(indeterminate),
value_for<n::manager>("unset"),
value_for<n::matches_requirement>(make_null_shared_ptr()),
value_for<n::name_requirement>("*"),
diff --git a/paludis/environments/paludis/output_managers/Makefile.am b/paludis/environments/paludis/output_managers/Makefile.am
index b2fdadb..46cf87b 100644
--- a/paludis/environments/paludis/output_managers/Makefile.am
+++ b/paludis/environments/paludis/output_managers/Makefile.am
@@ -15,6 +15,7 @@ dist_shareenvpaludis_DATA = \
logged.conf \
quiet.conf \
standard.conf \
+ standard_on_failure.conf \
keep_messages.part.conf \
keep_stdout_as_messages.part.conf \
logged_only.part.conf \
diff --git a/paludis/environments/paludis/output_managers/standard_on_failure.conf b/paludis/environments/paludis/output_managers/standard_on_failure.conf
new file mode 100644
index 0000000..f6dd6e0
--- /dev/null
+++ b/paludis/environments/paludis/output_managers/standard_on_failure.conf
@@ -0,0 +1,6 @@
+# This handler saves up output (in memory, so don't use it for big processes)
+# and displays it to standard only if an error occurs.
+
+handler = forward_on_failure
+child = standard
+