aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:49:56 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-01 17:49:56 +0000
commit2f133087711c5054a219da1c7dee4ff00614d43d (patch)
treeec75580eda3281432cba0a48ca5972928efc2533
parentb4dc82be87a87df7e15c49bd3042de625df34b65 (diff)
downloadpaludis-2f133087711c5054a219da1c7dee4ff00614d43d.tar.gz
paludis-2f133087711c5054a219da1c7dee4ff00614d43d.tar.xz
& does intersections, not unions.
-rw-r--r--paludis/fuzzy_finder.cc2
-rw-r--r--paludis/generator-fwd.hh2
-rw-r--r--paludis/generator.cc10
-rw-r--r--paludis/generator.hh4
-rw-r--r--paludis/generator_TEST.cc8
-rw-r--r--python/generator.cc8
-rw-r--r--ruby/generator.cc10
-rw-r--r--ruby/generator_TEST.rb6
8 files changed, 25 insertions, 25 deletions
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index 12d38e8..2511405 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -148,7 +148,7 @@ FuzzyCandidatesFinder::FuzzyCandidatesFinder(const Environment & e, const std::s
g = g & generator::Repository(*pds.repository_ptr());
}
- std::tr1::shared_ptr<const PackageIDSequence> ids(e[selection::SomeArbitraryVersion(g | FuzzyPackageName(package) | filter)]);
+ std::tr1::shared_ptr<const PackageIDSequence> ids(e[selection::BestVersionOnly(g | FuzzyPackageName(package) | filter)]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end())
; i != i_end ; ++i)
diff --git a/paludis/generator-fwd.hh b/paludis/generator-fwd.hh
index 1bc52dc..3a11c27 100644
--- a/paludis/generator-fwd.hh
+++ b/paludis/generator-fwd.hh
@@ -34,7 +34,7 @@ namespace paludis
class Package;
class Repository;
class Category;
- class Union;
+ class Intersection;
template <typename> class SomeIDsMightSupportAction;
}
diff --git a/paludis/generator.cc b/paludis/generator.cc
index 7ef28c4..a818d0c 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -351,13 +351,13 @@ namespace
}
};
- struct UnionGeneratorHandler :
+ struct IntersectionGeneratorHandler :
GeneratorHandler
{
const Generator g1;
const Generator g2;
- UnionGeneratorHandler(const Generator & h1, const Generator & h2) :
+ IntersectionGeneratorHandler(const Generator & h1, const Generator & h2) :
g1(h1),
g2(h2)
{
@@ -509,8 +509,8 @@ generator::Matches::Matches(const PackageDepSpec & spec) :
{
}
-generator::Union::Union(const Generator & g1, const Generator & g2) :
- Generator(make_shared_ptr(new UnionGeneratorHandler(g1, g2)))
+generator::Intersection::Intersection(const Generator & g1, const Generator & g2) :
+ Generator(make_shared_ptr(new IntersectionGeneratorHandler(g1, g2)))
{
}
@@ -523,7 +523,7 @@ generator::SomeIDsMightSupportAction<A_>::SomeIDsMightSupportAction() :
Generator
paludis::operator& (const Generator & g1, const Generator & g2)
{
- return generator::Union(g1, g2);
+ return generator::Intersection(g1, g2);
}
std::ostream &
diff --git a/paludis/generator.hh b/paludis/generator.hh
index d005240..c60e47f 100644
--- a/paludis/generator.hh
+++ b/paludis/generator.hh
@@ -106,11 +106,11 @@ namespace paludis
Category(const CategoryNamePart &);
};
- class PALUDIS_VISIBLE Union :
+ class PALUDIS_VISIBLE Intersection :
public Generator
{
public:
- Union(const Generator &, const Generator &);
+ Intersection(const Generator &, const Generator &);
};
template <typename>
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index 6b81906..38fa634 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.cc
@@ -269,10 +269,10 @@ namespace test_cases
}
} no_category_generator_test;
- struct UnionGeneratorTestCase : GeneratorTestCaseBase
+ struct IntersectionGeneratorTestCase : GeneratorTestCaseBase
{
- UnionGeneratorTestCase() :
- GeneratorTestCaseBase("union", generator::Union(
+ IntersectionGeneratorTestCase() :
+ GeneratorTestCaseBase("intersection", generator::Intersection(
generator::Matches(parse_user_package_dep_spec("*/a", UserPackageDepSpecOptions() + updso_allow_wildcards)),
generator::Matches(parse_user_package_dep_spec("cat/*", UserPackageDepSpecOptions() + updso_allow_wildcards))
))
@@ -287,7 +287,7 @@ namespace test_cases
"cat/a-1:0::repo2, "
"cat/a-2:0::repo2";
}
- } union_generator_test;
+ } intersection_generator_test;
struct SomeIDsMightSupportInstallActionGeneratorTestCase : GeneratorTestCaseBase
{
diff --git a/python/generator.cc b/python/generator.cc
index c74426c..cf44783 100644
--- a/python/generator.cc
+++ b/python/generator.cc
@@ -45,7 +45,7 @@ void expose_generator()
)
.def("__and__", static_cast<Generator (*) (const Generator &, const Generator &)>(
&paludis::operator& ),
- "Combine with another Generator using a set union."
+ "Combine with another Generator using a set intersection."
)
;
@@ -65,9 +65,9 @@ void expose_generator()
bp::init<const PackageDepSpec &>("__init__(spec)")
);
- bp::class_<generator::Union, bp::bases<Generator> > generator_union(
- "Union",
- "Generate packages from a union of two other Generator instances.",
+ bp::class_<generator::Intersection, bp::bases<Generator> > generator_intersection(
+ "Intersection",
+ "Generate packages from the intersection of two other Generator instances.",
bp::init<const Generator &, const Generator &>("__init__(generator, generator)")
);
diff --git a/ruby/generator.cc b/ruby/generator.cc
index 09f71e4..405eabc 100644
--- a/ruby/generator.cc
+++ b/ruby/generator.cc
@@ -33,7 +33,7 @@ namespace
static VALUE c_generator_package;
static VALUE c_generator_repository;
static VALUE c_generator_category;
- static VALUE c_generator_union;
+ static VALUE c_generator_intersection;
static VALUE c_generator_some_ids_might_support_action;
VALUE
@@ -171,14 +171,14 @@ namespace
}
VALUE
- generator_union_new(VALUE self, VALUE f1_v, VALUE f2_v)
+ generator_intersection_new(VALUE self, VALUE f1_v, VALUE f2_v)
{
Generator * ptr(0);
try
{
Generator f1(value_to_generator(f1_v));
Generator f2(value_to_generator(f2_v));
- ptr = new generator::Union(f1, f2);
+ ptr = new generator::Intersection(f1, f2);
VALUE data(Data_Wrap_Struct(self, 0, &Common<Generator>::free, ptr));
rb_obj_call_init(data, 2, &f1_v);
return data;
@@ -243,8 +243,8 @@ namespace
c_generator_matches = rb_define_class_under(c_generator_module, "Matches", c_generator);
rb_define_singleton_method(c_generator_matches, "new", RUBY_FUNC_CAST(&generator_matches_new), 1);
- c_generator_union = rb_define_class_under(c_generator_module, "Union", c_generator);
- rb_define_singleton_method(c_generator_union, "new", RUBY_FUNC_CAST(&generator_union_new), 2);
+ c_generator_intersection = rb_define_class_under(c_generator_module, "Intersection", c_generator);
+ rb_define_singleton_method(c_generator_intersection, "new", RUBY_FUNC_CAST(&generator_intersection_new), 2);
c_generator_package = rb_define_class_under(c_generator_module, "Package", c_generator);
rb_define_singleton_method(c_generator_package, "new", RUBY_FUNC_CAST(&generator_package_new), 1);
diff --git a/ruby/generator_TEST.rb b/ruby/generator_TEST.rb
index b8ba163..6e256b8 100644
--- a/ruby/generator_TEST.rb
+++ b/ruby/generator_TEST.rb
@@ -108,15 +108,15 @@ module Paludis
end
end
- class TestCase_GeneratorUnion < Test::Unit::TestCase
+ class TestCase_GeneratorIntersection < Test::Unit::TestCase
def test_create
assert_nothing_raised do
- Generator::Union.new(Generator::All.new, Generator::SomeIDsMightSupportAction.new(InstallAction))
+ Generator::Intersection.new(Generator::All.new, Generator::SomeIDsMightSupportAction.new(InstallAction))
end
end
def test_to_s
- assert_equal Generator::Union.new(Generator::All.new, Generator::SomeIDsMightSupportAction.new(InstallAction)).to_s,
+ assert_equal Generator::Intersection.new(Generator::All.new, Generator::SomeIDsMightSupportAction.new(InstallAction)).to_s,
"all packages intersected with packages that might support action install"
end
end