diff options
author | 2011-01-08 09:37:26 +0000 | |
---|---|---|
committer | 2011-01-08 09:40:58 +0000 | |
commit | f8d478e0e274ea05882d0b3de1dbe4dcdbce0d64 (patch) | |
tree | c9b7bee9b54590c9f675398f669938209def4f78 | |
parent | e1b0751bc45a46bd2007338036fe3deee921eaf3 (diff) | |
download | paludis-f8d478e0e274ea05882d0b3de1dbe4dcdbce0d64.tar.gz paludis-f8d478e0e274ea05882d0b3de1dbe4dcdbce0d64.tar.xz |
Don't rely upon bind discarding args
-rw-r--r-- | doc/api/cplusplus/examples/example_action.cc | 8 | ||||
-rw-r--r-- | paludis/legacy/install_task.cc | 10 | ||||
-rw-r--r-- | paludis/repositories/e/e_repository_TEST.cc | 5 | ||||
-rw-r--r-- | python/action.cc | 3 | ||||
-rw-r--r-- | ruby/action.cc | 18 | ||||
-rw-r--r-- | src/clients/accerso/accerso.cc | 13 | ||||
-rw-r--r-- | src/clients/appareo/appareo.cc | 10 | ||||
-rw-r--r-- | src/clients/cave/cmd_digest.cc | 8 | ||||
-rwxr-xr-x | src/clients/cave/cmd_display_resolution.cc | 8 | ||||
-rw-r--r-- | src/clients/cave/cmd_perform.cc | 8 |
10 files changed, 59 insertions, 32 deletions
diff --git a/doc/api/cplusplus/examples/example_action.cc b/doc/api/cplusplus/examples/example_action.cc index 05bdb6f0c..7dd5c905b 100644 --- a/doc/api/cplusplus/examples/example_action.cc +++ b/doc/api/cplusplus/examples/example_action.cc @@ -34,6 +34,12 @@ namespace { return std::make_shared<StandardOutputManager>(); } + + /* We just want to run all phases for actions. */ + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } } int main(int argc, char * argv[]) @@ -84,7 +90,7 @@ int main(int argc, char * argv[]) n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); try { diff --git a/paludis/legacy/install_task.cc b/paludis/legacy/install_task.cc index 3cd20133e..8450feffb 100644 --- a/paludis/legacy/install_task.cc +++ b/paludis/legacy/install_task.cc @@ -49,7 +49,6 @@ #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/util/make_null_shared_ptr.hh> #include <paludis/create_output_manager_info.hh> #include <paludis/output_manager_from_environment.hh> @@ -693,6 +692,11 @@ namespace task.on_display_failure_summary_success(*entry); } }; + + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } } void @@ -784,7 +788,7 @@ InstallTask::_pretend() n::ignore_unfetched() = true, n::make_output_manager() = std::ref(output_manager_holder), n::safe_resume() = _imp->safe_resume, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); FetchAction fetch_action(options); try @@ -1966,7 +1970,7 @@ InstallTask::make_fetch_action_options(const DepListEntry &, OutputManagerFromEn n::ignore_unfetched() = false, n::make_output_manager() = std::ref(o), n::safe_resume() = _imp->safe_resume, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases ); } diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc index bdfe329e6..3ea84e789 100644 --- a/paludis/repositories/e/e_repository_TEST.cc +++ b/paludis/repositories/e/e_repository_TEST.cc @@ -31,7 +31,6 @@ #include <paludis/util/map.hh> #include <paludis/util/make_named_values.hh> #include <paludis/util/set.hh> -#include <paludis/util/return_literal_function.hh> #include <paludis/util/fs_stat.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/standard_output_manager.hh> @@ -938,7 +937,7 @@ namespace test_cases n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); { @@ -1046,7 +1045,7 @@ namespace test_cases n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); const std::shared_ptr<const PackageID> id(*env[selection::AllVersionsSorted(generator::Matches( diff --git a/python/action.cc b/python/action.cc index a220bb76a..1803b5431 100644 --- a/python/action.cc +++ b/python/action.cc @@ -23,7 +23,6 @@ #include <paludis/action.hh> #include <paludis/util/make_named_values.hh> #include <paludis/util/sequence.hh> -#include <paludis/util/return_literal_function.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/standard_output_manager.hh> #include <paludis/repository.hh> @@ -140,7 +139,7 @@ namespace n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = safe_resume, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); } diff --git a/ruby/action.cc b/ruby/action.cc index 5d525f22b..3876b00df 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, 2010 Ciaran McCreesh + * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh * Copyright (c) 2007 Richard Brown * * This file is part of the Paludis package manager. Paludis is free software; @@ -21,7 +21,6 @@ #include <paludis_ruby.hh> #include <paludis/action.hh> #include <paludis/util/make_named_values.hh> -#include <paludis/util/return_literal_function.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/standard_output_manager.hh> #include <ruby.h> @@ -52,6 +51,11 @@ namespace static VALUE c_pretend_fetch_action; + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } + const FetchActionOptions value_to_fetch_action_options(VALUE v) { @@ -293,7 +297,7 @@ namespace n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = v_safe_resume, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); VALUE tdata(Data_Wrap_Struct(self, 0, &Common<FetchActionOptions>::free, ptr)); @@ -506,11 +510,6 @@ namespace } }; - WantPhase want_all_phases(const std::string &) - { - return wp_yes; - } - void cannot_perform_uninstall(const std::shared_ptr<const PackageID> & id, const UninstallActionOptions &) { throw InternalError(PALUDIS_HERE, "Can't uninstall '" + stringify(*id) + "'"); @@ -530,15 +529,12 @@ namespace InstallActionOptions * ptr(0); try { - bool v_no_config_protect; std::shared_ptr<Repository> v_destination; if (1 == argc && rb_obj_is_kind_of(argv[0], rb_cHash)) { if (Qnil == rb_hash_aref(argv[0], ID2SYM(rb_intern("destination")))) rb_raise(rb_eArgError, "Missing Parameter: destination"); - v_no_config_protect = - value_to_bool(rb_hash_aref(argv[0], ID2SYM(rb_intern("no_config_protect")))); v_destination = value_to_repository(rb_hash_aref(argv[0], ID2SYM(rb_intern("destination")))); } else if (1 == argc) diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc index c8e109c33..5e615f22d 100644 --- a/src/clients/accerso/accerso.cc +++ b/src/clients/accerso/accerso.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2007, 2008, 2009, 2010, 2011 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 @@ -30,7 +30,6 @@ #include <paludis/util/map.hh> #include <paludis/util/make_named_values.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> @@ -51,6 +50,14 @@ using std::cout; using std::cerr; using std::endl; +namespace +{ + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } +} + int main(int argc, char *argv[]) { @@ -149,7 +156,7 @@ main(int argc, char *argv[]) n::ignore_unfetched() = false, n::make_output_manager() = std::ref(output_manager_holder), n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); try diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc index 3221042d9..e18bd1b0d 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, 2010 Ciaran McCreesh + * Copyright (c) 2007, 2008, 2009, 2010, 2011 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 @@ -31,7 +31,6 @@ #include <paludis/util/sequence.hh> #include <paludis/util/map.hh> #include <paludis/util/make_named_values.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> @@ -60,6 +59,11 @@ namespace return std::make_shared<StandardOutputManager>(); } + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } + FSPath get_location_and_add_filters() { Context context("When determining tree location:"); @@ -113,7 +117,7 @@ namespace n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); (*i)->perform_action(a); ++success; diff --git a/src/clients/cave/cmd_digest.cc b/src/clients/cave/cmd_digest.cc index c47a153b4..aadfe2fca 100644 --- a/src/clients/cave/cmd_digest.cc +++ b/src/clients/cave/cmd_digest.cc @@ -30,7 +30,6 @@ #include <paludis/util/iterator_funcs.hh> #include <paludis/util/map.hh> #include <paludis/util/make_named_values.hh> -#include <paludis/util/return_literal_function.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/name.hh> @@ -91,6 +90,11 @@ namespace { return std::make_shared<StandardOutputManager>(); } + + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } } int @@ -135,7 +139,7 @@ DigestCommand::run( n::ignore_unfetched() = false, n::make_output_manager() = &make_standard_output_manager, n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); if ((*i)->supports_action(SupportsActionTest<FetchAction>())) diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc index 310323872..38ad4f035 100755 --- a/src/clients/cave/cmd_display_resolution.cc +++ b/src/clients/cave/cmd_display_resolution.cc @@ -40,7 +40,6 @@ #include <paludis/util/log.hh> #include <paludis/util/pretty_print.hh> #include <paludis/util/make_null_shared_ptr.hh> -#include <paludis/util/return_literal_function.hh> #include <paludis/util/enum_iterator.hh> #include <paludis/resolver/resolutions_by_resolvent.hh> #include <paludis/resolver/reason.hh> @@ -134,6 +133,11 @@ namespace } }; + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } + std::string get_annotation( const std::shared_ptr<const DepSpecAnnotations> & annotations, const DepSpecAnnotationRole role) @@ -1124,7 +1128,7 @@ namespace n::ignore_unfetched() = false, n::make_output_manager() = std::ref(output_manager_holder), n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases ), totals); id->perform_action(action); diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc index 2dcdf172c..a4edf188e 100644 --- a/src/clients/cave/cmd_perform.cc +++ b/src/clients/cave/cmd_perform.cc @@ -42,7 +42,6 @@ #include <paludis/util/wrapped_forward_iterator.hh> #include <paludis/util/make_named_values.hh> #include <paludis/util/iterator_funcs.hh> -#include <paludis/util/return_literal_function.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <cstdlib> #include <iostream> @@ -383,6 +382,11 @@ namespace size = new_size; } }; + + WantPhase want_all_phases(const std::string &) + { + return wp_yes; + } } int @@ -502,7 +506,7 @@ PerformCommand::run( n::ignore_unfetched() = cmdline.a_ignore_unfetched.specified(), n::make_output_manager() = std::ref(output_manager_holder), n::safe_resume() = true, - n::want_phase() = std::bind(return_literal_function(wp_yes)) + n::want_phase() = &want_all_phases )); OurPretendFetchAction pretend_fetch_action(options); execute(env, cmdline, id, action, pretend_fetch_action, output_manager_holder); |