aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/api/cplusplus/examples/example_action.cc3
-rw-r--r--paludis/action.hh19
-rw-r--r--paludis/install_task.cc7
-rw-r--r--paludis/repositories/e/e_repository.cc25
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc9
-rw-r--r--python/action.cc4
-rw-r--r--ruby/action.cc6
-rw-r--r--src/clients/accerso/accerso.cc4
-rw-r--r--src/clients/appareo/appareo.cc6
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc27
-rw-r--r--src/clients/cave/cmd_perform.cc8
11 files changed, 97 insertions, 21 deletions
diff --git a/doc/api/cplusplus/examples/example_action.cc b/doc/api/cplusplus/examples/example_action.cc
index 573d066..d16f0a1 100644
--- a/doc/api/cplusplus/examples/example_action.cc
+++ b/doc/api/cplusplus/examples/example_action.cc
@@ -80,10 +80,11 @@ int main(int argc, char * argv[])
value_for<n::errors>(failures),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_extras),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
try
{
diff --git a/paludis/action.hh b/paludis/action.hh
index 2c1f956..a36d883 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -98,6 +98,14 @@ namespace paludis
*/
NamedValue<n::fetch_parts, FetchParts> fetch_parts;
+ /**
+ * Ignore if a package is or isn't referenced in the Manifest.
+ * It's useful with appareo not to get errors before generating it.
+ *
+ * \since 0.46
+ */
+ NamedValue<n::ignore_not_in_manifest, bool> ignore_not_in_manifest;
+
/**
* Ignore any unfetched packages. Verify digests for anything that's
* already there, and if we know for sure manual fetching will be
@@ -119,13 +127,10 @@ namespace paludis
NamedValue<n::safe_resume, bool> safe_resume;
- /**
- * Ignore if a package is or isn't referenced in the Manifest.
- * It's useful with appareo not to get errors before generating it.
- *
- * \since 0.46
- */
- NamedValue<n::ignore_not_in_manifest, bool> ignore_not_in_manifest;
+ /**
+ * \since 0.48
+ */
+ NamedValue<n::want_phase, std::tr1::function<WantPhase (const std::string &)> > want_phase;
};
/**
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 3ec8b63..24c9ffa 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -49,6 +49,7 @@
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/handled_information.hh>
#include <paludis/create_output_manager_info.hh>
#include <paludis/output_manager_from_environment.hh>
@@ -765,10 +766,11 @@ InstallTask::_pretend()
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_extras),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(true),
value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder)),
value_for<n::safe_resume>(_imp->safe_resume),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
FetchAction fetch_action(options);
try
@@ -1933,10 +1935,11 @@ InstallTask::make_fetch_action_options(const DepListEntry &, OutputManagerFromEn
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_extras),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(std::tr1::ref(o)),
value_for<n::safe_resume>(_imp->safe_resume),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
);
}
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 5b21caf..d7836e7 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -2051,6 +2051,31 @@ ERepository::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
for (EAPIPhases::ConstIterator phase(fetch_extra_phases.begin_phases()), phase_end(fetch_extra_phases.end_phases()) ;
phase != phase_end ; ++phase)
{
+ bool skip(false);
+ do
+ {
+ switch (fetch_action.options.want_phase()(phase->equal_option("skipname")))
+ {
+ case wp_yes:
+ continue;
+
+ case wp_skip:
+ skip = true;
+ continue;
+
+ case wp_abort:
+ throw ActionAbortedError("Told to abort fetch");
+
+ case last_wp:
+ break;
+ }
+
+ throw InternalError(PALUDIS_HERE, "bad want_phase");
+ } while (false);
+
+ if (skip)
+ continue;
+
if (can_skip_phase(id, *phase))
continue;
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 76f84c6..7c92432 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 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
@@ -32,6 +32,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -938,10 +939,11 @@ namespace test_cases
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_extras),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
{
@@ -1046,10 +1048,11 @@ namespace test_cases
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_extras),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
const std::tr1::shared_ptr<const PackageID> id(*env[selection::AllVersionsSorted(generator::Matches(
diff --git a/python/action.cc b/python/action.cc
index 0b4524a..b4bb242 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -24,6 +24,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/repository.hh>
#include <tr1/memory>
@@ -132,10 +133,11 @@ namespace
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(exclude_unmirrorable),
value_for<n::fetch_parts>(parts),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(safe_resume),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
}
diff --git a/ruby/action.cc b/ruby/action.cc
index a3c8231..8792d14 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2007 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -22,6 +22,7 @@
#include <paludis/action.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/standard_output_manager.hh>
#include <ruby.h>
@@ -257,10 +258,11 @@ namespace
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(v_exclude_unmirrorable),
value_for<n::fetch_parts>(parts),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(v_safe_resume),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<FetchActionOptions>::free, ptr));
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 3bfbd25..934bd8e 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -32,6 +32,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/pretty_print.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/create_output_manager_info.hh>
@@ -146,10 +147,11 @@ main(int argc, char *argv[])
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(true),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_unneeded),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder)),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
try
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index 59dbc8c..0383658 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2009 Kim Højgaard-Hansen
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 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
@@ -32,6 +32,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
@@ -108,10 +109,11 @@ namespace
value_for<n::errors>(failures),
value_for<n::exclude_unmirrorable>(false),
value_for<n::fetch_parts>(FetchParts() + fp_regulars + fp_extras + fp_unneeded),
+ value_for<n::ignore_not_in_manifest>(true),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(true)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
(*i)->perform_action(a);
++success;
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 1b5c59c..265b058 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -243,6 +243,33 @@ namespace
if (normal_only)
command.append(" --regulars-only");
+ if (cmdline.execution_options.a_skip_phase.specified() || cmdline.execution_options.a_abort_at_phase.specified()
+ || cmdline.execution_options.a_skip_until_phase.specified())
+ {
+ bool apply(false);
+
+ if (cmdline.execution_options.a_change_phases_for.argument() == "all")
+ apply = true;
+ else if (cmdline.execution_options.a_change_phases_for.argument() == "first")
+ apply = (x == 1);
+ else if (cmdline.execution_options.a_change_phases_for.argument() == "last")
+ apply = (x == y);
+ else
+ throw args::DoHelp("Don't understand argument '"
+ + cmdline.execution_options.a_change_phases_for.argument() + "' to '--"
+ + cmdline.execution_options.a_change_phases_for.long_name() + "'");
+
+ if (apply)
+ {
+ if (cmdline.execution_options.a_skip_phase.specified())
+ command.append(" " + cmdline.execution_options.a_skip_phase.forwardable_string());
+ if (cmdline.execution_options.a_abort_at_phase.specified())
+ command.append(" " + cmdline.execution_options.a_abort_at_phase.forwardable_string());
+ if (cmdline.execution_options.a_skip_until_phase.specified())
+ command.append(" " + cmdline.execution_options.a_skip_until_phase.forwardable_string());
+ }
+ }
+
if (cmdline.import_options.a_unpackaged_repository_params.specified())
{
for (args::StringSetArg::ConstIterator p(cmdline.import_options.a_unpackaged_repository_params.begin_args()),
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 8316871..2af0620 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -42,6 +42,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/return_literal_function.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
@@ -392,14 +393,16 @@ PerformCommand::run(
return EXIT_SUCCESS;
OutputManagerFromIPCOrEnvironment output_manager_holder(env.get(), cmdline, id);
+ WantInstallPhase want_phase(cmdline, output_manager_holder);
FetchActionOptions options(make_named_values<FetchActionOptions>(
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(cmdline.a_exclude_unmirrorable.specified()),
value_for<n::fetch_parts>(parts),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(cmdline.a_ignore_unfetched.specified()),
value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder)),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(want_phase)
));
FetchAction fetch_action(options);
execute(env, cmdline, id, action, fetch_action);
@@ -414,10 +417,11 @@ PerformCommand::run(
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(cmdline.a_exclude_unmirrorable.specified()),
value_for<n::fetch_parts>(parts),
+ value_for<n::ignore_not_in_manifest>(false),
value_for<n::ignore_unfetched>(cmdline.a_ignore_unfetched.specified()),
value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder)),
value_for<n::safe_resume>(true),
- value_for<n::ignore_not_in_manifest>(false)
+ value_for<n::want_phase>(std::tr1::bind(return_literal_function(wp_yes)))
));
OurPretendFetchAction pretend_fetch_action(options);
execute(env, cmdline, id, action, pretend_fetch_action);