aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-06 18:09:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-06 18:09:17 +0000
commitd6f5e30e1c5843a7644e79963950228cb04b4fb6 (patch)
treef82b0685c60cd797c2a8cd20d2ad2c7da841a8e4
parent1d7fa3dd097834ee102a741b245b669cb3387661 (diff)
downloadpaludis-d6f5e30e1c5843a7644e79963950228cb04b4fb6.tar.gz
paludis-d6f5e30e1c5843a7644e79963950228cb04b4fb6.tar.xz
No need for PackageDepSpec::without_additional_requirements
-rw-r--r--paludis/dep_list.cc4
-rw-r--r--paludis/dep_spec.cc48
-rw-r--r--paludis/dep_spec.hh7
-rw-r--r--paludis/range_rewriter.cc7
-rw-r--r--python/dep_spec.cc13
-rw-r--r--python/dep_spec.hh1
-rwxr-xr-xpython/dep_spec_TEST.py6
-rw-r--r--ruby/dep_spec.cc18
-rw-r--r--ruby/dep_spec_TEST.rb10
9 files changed, 7 insertions, 107 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index aa2552a..65595f8 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 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
@@ -584,7 +584,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
throw AllMaskedError(*node.spec());
std::tr1::shared_ptr<const PackageIDSequence> match_except_reqs((*d->_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(*node.spec()->without_additional_requirements(), d->_imp->opts->match_package_options()))]);
+ generator::Matches(*node.spec(), d->_imp->opts->match_package_options() + mpo_ignore_additional_requirements))]);
for (PackageIDSequence::ConstIterator i(match_except_reqs->begin()),
i_end(match_except_reqs->end()) ; i != i_end ; ++i)
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 189969e..7eed373 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 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
@@ -735,52 +735,6 @@ PackageDepSpec::additional_requirements_ptr() const
return _imp->data->additional_requirements_ptr();
}
-std::tr1::shared_ptr<PackageDepSpec>
-PackageDepSpec::without_additional_requirements() const
-{
- using namespace std::tr1::placeholders;
-
- PartiallyMadePackageDepSpec result(data()->options_for_partially_made_package_dep_spec());
-
- if (package_ptr())
- result.package(*package_ptr());
-
- if (package_name_part_ptr())
- result.package_name_part(*package_name_part_ptr());
-
- if (category_name_part_ptr())
- result.category_name_part(*category_name_part_ptr());
-
- if (version_requirements_ptr())
- std::for_each(version_requirements_ptr()->begin(), version_requirements_ptr()->end(),
- std::tr1::bind(&PartiallyMadePackageDepSpec::version_requirement, &result, _1));
-
- result.version_requirements_mode(version_requirements_mode());
-
- if (slot_requirement_ptr())
- result.slot_requirement(slot_requirement_ptr());
-
- if (in_repository_ptr())
- result.in_repository(*in_repository_ptr());
-
- if (from_repository_ptr())
- result.from_repository(*from_repository_ptr());
-
- if (installed_at_path_ptr())
- result.installed_at_path(*installed_at_path_ptr());
-
- if (installable_to_path_ptr())
- result.installable_to_path(*installable_to_path_ptr());
-
- if (installable_to_repository_ptr())
- result.installable_to_repository(*installable_to_repository_ptr());
-
- if (annotations_key())
- result.annotations(annotations_key());
-
- return make_shared_ptr(new PackageDepSpec(result));
-}
-
std::tr1::shared_ptr<const DepTag>
PackageDepSpec::tag() const
{
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 071b706..598c265 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 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
@@ -590,11 +590,6 @@ namespace paludis
void set_tag(const std::tr1::shared_ptr<const DepTag> & s);
/**
- * Fetch a copy of ourself without additional requirements.
- */
- std::tr1::shared_ptr<PackageDepSpec> without_additional_requirements() const;
-
- /**
* Access to our data.
*/
std::tr1::shared_ptr<const PackageDepSpecData> data() const;
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index c4ab5e8..0ce918c 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.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
*
* 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
@@ -154,11 +154,6 @@ namespace
version_requirements->back_inserter());
}
- std::tr1::shared_ptr<const PackageDepSpecData> without_additional_requirements() const
- {
- return make_shared_ptr(new RangeRewrittenPackageDepSpecData(*this));
- }
-
std::tr1::shared_ptr<const PackageDepSpecData> without_slot_requirements() const
{
return make_shared_ptr(new RangeRewrittenPackageDepSpecData(*this));
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 3b1b409..ea6f4f8 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -329,14 +329,6 @@ PythonPackageDepSpec::as_package_dep_spec() const
return this;
}
-const std::tr1::shared_ptr<const PythonPackageDepSpec>
-PythonPackageDepSpec::without_additional_requirements() const
-{
- PackageDepSpec p(*this);
-
- return make_shared_ptr(new PythonPackageDepSpec(*p.without_additional_requirements()));
-}
-
std::tr1::shared_ptr<const QualifiedPackageName>
PythonPackageDepSpec::package_ptr() const
{
@@ -1263,11 +1255,6 @@ void expose_dep_spec()
)
#endif
- .def("without_additional_requirements", &PythonPackageDepSpec::without_additional_requirements,
- "without_additional_requirements() -> PackageDepSpec\n"
- "Fetch a copy of ourself without additional requirements."
- )
-
.def("__str__", &PythonPackageDepSpec::py_str)
;
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index 57cbefc..f726a02 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -175,7 +175,6 @@ namespace paludis
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const;
std::tr1::shared_ptr<const DepTag> tag() const;
void set_tag(const std::tr1::shared_ptr<const DepTag> & s);
- const std::tr1::shared_ptr<const PythonPackageDepSpec> without_additional_requirements() const;
std::string py_str() const;
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index 5254f36..556f24b 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -88,12 +88,6 @@ class TestCase_1_DepSpecs(unittest.TestCase):
### ur = iter(spec.additional_requirements).next()
### self.assert_(isinstance(ur, EnabledUseRequirement))
- def test_10_without_additional_requirements(self):
- spec = parse_user_package_dep_spec("foo/monkey[foo]", TestEnvironment(), UserPackageDepSpecOptions())
- pds = spec.without_additional_requirements()
-### self.assertEquals(pds.additional_requirements, None)
-### self.assertEquals(str(pds), "foo/monkey")
-
def test_11_name(self):
self.get_depspecs()
self.assertEqual(str(self.nds.text), "system")
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index d5205b0..12cc845 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.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
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -595,21 +595,6 @@ namespace
/*
* call-seq:
- * without_additional_requirements -> PackageDepSpec
- *
- * Fetch us without our use requirements.
- */
- VALUE
- package_dep_spec_without_additional_requirements(VALUE self)
- {
- std::tr1::shared_ptr<WrappedSpecBase> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<WrappedSpecBase>, ptr);
- return package_dep_spec_to_value(std::tr1::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(
- *ptr)->spec()->without_additional_requirements());
- }
-
- /*
- * call-seq:
* package -> QualifiedPackageName or Nil
*
* Fetch the package name.
@@ -1237,7 +1222,6 @@ namespace
#endif
rb_define_method(c_package_dep_spec, "tag", RUBY_FUNC_CAST(&package_dep_spec_tag), 0);
rb_define_method(c_package_dep_spec, "tag=", RUBY_FUNC_CAST(&package_dep_spec_set_tag), 1);
- rb_define_method(c_package_dep_spec, "without_additional_requirements", RUBY_FUNC_CAST(&package_dep_spec_without_additional_requirements), 0);
VALUE (* package_dep_spec_to_s) (VALUE) = &dep_spec_to_s<PackageDepSpec>;
rb_define_method(c_package_dep_spec, "to_s", RUBY_FUNC_CAST(package_dep_spec_to_s), 0);
diff --git a/ruby/dep_spec_TEST.rb b/ruby/dep_spec_TEST.rb
index 968e9a7..1ded865 100644
--- a/ruby/dep_spec_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
# Copyright (c) 2007 Richard Brown
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -234,14 +234,6 @@ module Paludis
### assert_equal false, pda.use_requirements[1][:state]
### end
- def test_without_additional_requirements
- assert_equal ">=foo/bar-1:100::testrepo", pda.without_additional_requirements.to_s
- assert_equal "*/bar", pdb.without_additional_requirements.to_s
- assert_equal "foo/bar::installed?", pdc.without_additional_requirements.to_s
- assert_equal "foo/*::/??", pdd.without_additional_requirements.to_s
- assert_equal "foo/bar::testrepo->/mychroot", pde.without_additional_requirements.to_s
- end
-
def test_tag
assert_nil pda.tag
assert_nil pdb.tag