aboutsummaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-22 22:52:48 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-22 22:52:48 +0000
commitf946430c361864a353707eb91b48209ba7b52550 (patch)
treecb29a164a4756b92b23d97e40cef7ac880ef08c1 /ruby
parent01456e93f0e6e5dd4ce3632b1590e3cf4609b646 (diff)
downloadpaludis-f946430c361864a353707eb91b48209ba7b52550.tar.gz
paludis-f946430c361864a353707eb91b48209ba7b52550.tar.xz
Split up fetching, and give it its own job
Diffstat (limited to 'ruby')
-rw-r--r--ruby/action.cc11
-rw-r--r--ruby/action_TEST.rb4
2 files changed, 7 insertions, 8 deletions
diff --git a/ruby/action.cc b/ruby/action.cc
index 04d86d9f1..9febae147 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -248,11 +248,15 @@ namespace
rb_raise(rb_eArgError, "FetchActionOptions expects one or three arguments, but got %d",argc);
}
+ FetchParts parts;
+ parts = parts + fp_regulars + fp_extras;
+ if (v_fetch_unneeded)
+ parts += fp_unneeded;
+
ptr = new FetchActionOptions(make_named_values<FetchActionOptions>(
value_for<n::errors>(make_shared_ptr(new Sequence<FetchActionFailure>)),
value_for<n::exclude_unmirrorable>(v_exclude_unmirrorable),
- value_for<n::fetch_regulars_only>(false),
- value_for<n::fetch_unneeded>(v_fetch_unneeded),
+ value_for<n::fetch_parts>(parts),
value_for<n::ignore_unfetched>(false),
value_for<n::make_output_manager>(&make_standard_output_manager),
value_for<n::safe_resume>(v_safe_resume)
@@ -743,9 +747,6 @@ namespace
c_fetch_action_options = rb_define_class_under(paludis_module(), "FetchActionOptions", rb_cObject);
rb_define_singleton_method(c_fetch_action_options, "new", RUBY_FUNC_CAST(&fetch_action_options_new), -1);
rb_define_method(c_fetch_action_options, "initialize", RUBY_FUNC_CAST(&empty_init), -1);
- rb_define_method(c_fetch_action_options, "fetch_unneeded?",
- RUBY_FUNC_CAST((&NVFetch<FetchActionOptions, n::fetch_unneeded, bool,
- &FetchActionOptions::fetch_unneeded>::fetch)), 0);
rb_define_method(c_fetch_action_options, "safe_resume?",
RUBY_FUNC_CAST((&NVFetch<FetchActionOptions, n::safe_resume, bool,
&FetchActionOptions::safe_resume>::fetch)), 0);
diff --git a/ruby/action_TEST.rb b/ruby/action_TEST.rb
index 0b5fd3ce2..57e6bda46 100644
--- a/ruby/action_TEST.rb
+++ b/ruby/action_TEST.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2007, 2008, 2009 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
@@ -167,12 +167,10 @@ module Paludis
def test_options
a = FetchAction.new(FetchActionOptions.new(false, true, false))
assert_kind_of FetchActionOptions, a.options
- assert !a.options.fetch_unneeded?
assert a.options.safe_resume?
a = FetchAction.new(FetchActionOptions.new({:safe_resume => false, :fetch_unneeded => true, :exclude_unmirrorable => false}))
assert_kind_of FetchActionOptions, a.options
- assert a.options.fetch_unneeded?
assert !a.options.safe_resume?
assert !a.options.exclude_unmirrorable?
end