aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-12 01:11:43 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-12 01:12:11 +0100
commit0c9893ceeca308897238e4c2190607d570f7feba (patch)
tree9c705b1f4bb1ece4790f3f547e993f4d72e8cd0f
parent8653241b4e943999757f30451f24a2ccc8d9862c (diff)
downloadpaludis-0c9893ceeca308897238e4c2190607d570f7feba.tar.gz
paludis-0c9893ceeca308897238e4c2190607d570f7feba.tar.xz
Kill AssociationMask
-rw-r--r--doc/api/cplusplus/examples/example_mask.cc6
-rw-r--r--doc/api/ruby/example_mask.rb3
-rw-r--r--doc/faq/howdoi.html.part5
-rw-r--r--paludis/mask-fwd.hh1
-rw-r--r--paludis/mask.cc5
-rw-r--r--paludis/mask.hh26
-rw-r--r--paludis/mask_utils.cc5
-rw-r--r--paludis/user_dep_spec.cc10
-rw-r--r--python/additional_tests.cc7
-rw-r--r--python/mask.cc76
-rwxr-xr-xpython/mask_TEST.py14
-rwxr-xr-xpython/mask_TEST_setup.sh4
-rw-r--r--ruby/mask.cc34
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc6
-rw-r--r--src/clients/cave/cmd_print_id_masks.cc5
-rw-r--r--src/clients/cave/cmd_print_ids.cc11
-rw-r--r--src/clients/cave/cmd_show.cc13
-rw-r--r--zsh-completion/_cave2
18 files changed, 2 insertions, 231 deletions
diff --git a/doc/api/cplusplus/examples/example_mask.cc b/doc/api/cplusplus/examples/example_mask.cc
index c9fd67a..8f2bd7c 100644
--- a/doc/api/cplusplus/examples/example_mask.cc
+++ b/doc/api/cplusplus/examples/example_mask.cc
@@ -61,12 +61,6 @@ namespace
cout << left << setw(30) << " Class:" << " " << "UnsupportedMask" << endl;
cout << left << setw(30) << " Explanation:" << " " << mask.explanation() << endl;
}
-
- void visit(const AssociationMask & mask)
- {
- cout << left << setw(30) << " Class:" << " " << "AssociationMask" << endl;
- cout << left << setw(30) << " Associated package:" << " " << mask.associated_package_spec() << endl;
- }
};
}
diff --git a/doc/api/ruby/example_mask.rb b/doc/api/ruby/example_mask.rb
index d8724db..fd99e64 100644
--- a/doc/api/ruby/example_mask.rb
+++ b/doc/api/ruby/example_mask.rb
@@ -39,9 +39,6 @@ ids.each do | id |
elsif mask.kind_of? UnsupportedMask
puts " Class: ".ljust(31) + 'UnsupportedMask'
puts " Explanation: ".ljust(31) + mask.explanation
- elsif mask.kind_of? AssociationMask
- puts " Class: ".ljust(31) + 'AssociationMask'
- puts " Associated package: ".ljust(31) + mask.associated_package_spec.to_s
else
puts " Class: ".ljust(31) + 'Unknown'
end
diff --git a/doc/faq/howdoi.html.part b/doc/faq/howdoi.html.part
index a239510..019c286 100644
--- a/doc/faq/howdoi.html.part
+++ b/doc/faq/howdoi.html.part
@@ -82,11 +82,6 @@ reasons:</p>
<dt>license</dt>
<dd>Accept the appropriate licences in <code>licenses.conf</code>.</dd>
-
- <dt>by association</dt>
-
- <dd>Unmask the associated package. This mask reason is currently only used
- for old style virtuals.</dd>
</dl>
<h2 id="syncfromcvs">Sync from CVS</h2>
diff --git a/paludis/mask-fwd.hh b/paludis/mask-fwd.hh
index f102250..fef3044 100644
--- a/paludis/mask-fwd.hh
+++ b/paludis/mask-fwd.hh
@@ -36,7 +36,6 @@ namespace paludis
class UnacceptedMask;
class RepositoryMask;
class UnsupportedMask;
- class AssociationMask;
struct OverriddenMask;
diff --git a/paludis/mask.cc b/paludis/mask.cc
index 0f3bafd..ae3f6c2 100644
--- a/paludis/mask.cc
+++ b/paludis/mask.cc
@@ -60,11 +60,6 @@ namespace
{
return "";
}
-
- std::string visit(const AssociationMask &) const
- {
- return "";
- }
};
}
diff --git a/paludis/mask.hh b/paludis/mask.hh
index 39b7f9f..602c4c6 100644
--- a/paludis/mask.hh
+++ b/paludis/mask.hh
@@ -71,7 +71,7 @@ namespace paludis
*/
class PALUDIS_VISIBLE Mask :
public virtual DeclareAbstractAcceptMethods<Mask, MakeTypeList<
- UserMask, UnacceptedMask, RepositoryMask, UnsupportedMask, AssociationMask>::Type>
+ UserMask, UnacceptedMask, RepositoryMask, UnsupportedMask>::Type>
{
public:
///\name Basic operations
@@ -193,30 +193,6 @@ namespace paludis
};
/**
- * An AssociationMask is a Mask that signifies that a PackageID is masked
- * because of its association with another PackageID that is itself masked.
- *
- * This is used by old-style virtuals. If the provider of a virtual is
- * masked then the virtual itself is masked by association.
- *
- * \ingroup g_mask
- * \since 0.26
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE AssociationMask :
- public Mask,
- public ImplementAcceptMethods<Mask, AssociationMask>
- {
- public:
- /**
- * Fetch a spec identifying the associated package.
- *
- * \since 0.59
- */
- virtual const PackageDepSpec associated_package_spec() const = 0;
- };
-
- /**
* An OverriddenMask holds a Mask and an explanation of why it has been overridden.
*
* \ingroup g_mask
diff --git a/paludis/mask_utils.cc b/paludis/mask_utils.cc
index b812090..7a26dd4 100644
--- a/paludis/mask_utils.cc
+++ b/paludis/mask_utils.cc
@@ -75,11 +75,6 @@ namespace
{
return false;
}
-
- bool visit(const AssociationMask &) const
- {
- return false;
- }
};
}
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index ab3ec11..404f42d 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -868,11 +868,6 @@ namespace
{
return 0;
}
-
- const MetadataKey * const visit(const AssociationMask &) const
- {
- return 0;
- }
};
struct MaskChecker
@@ -898,11 +893,6 @@ namespace
{
return key == "*" || key == "unsupported";
}
-
- bool visit(const AssociationMask &) const
- {
- return key == "*" || key == "association";
- }
};
}
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index a9671ff..8f81263 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -118,12 +118,6 @@ namespace mask
test_mask(m);
m.explanation();
}
-
- void test_association_mask(AssociationMask & m)
- {
- test_mask(m);
- m.associated_package_spec();
- }
}
namespace metadata_key
@@ -209,7 +203,6 @@ void expose_additional_tests()
bp::def("test_unaccepted_mask", &mask::test_unaccepted_mask);
bp::def("test_repository_mask", &mask::test_repository_mask);
bp::def("test_unsupported_mask", &mask::test_unsupported_mask);
- bp::def("test_association_mask", &mask::test_association_mask);
/**
* MetadataKey tests
diff --git a/python/mask.cc b/python/mask.cc
index ce48d4b..71e12d9 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -60,11 +60,6 @@ class MaskSptrToPythonVisitor
{
obj = bp::object(std::static_pointer_cast<const UnsupportedMask>(_m_ptr));
}
-
- void visit(const AssociationMask & m)
- {
- obj = bp::object(std::static_pointer_cast<const AssociationMask>(_m_ptr));
- }
};
struct MaskSptrToPython
@@ -268,42 +263,6 @@ struct UnsupportedMaskWrapper :
}
};
-struct AssociationMaskWrapper :
- AssociationMask,
- bp::wrapper<AssociationMask>
-{
- virtual const PackageDepSpec associated_package_spec() const
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("associated_package_spec"))
- return f();
- else
- throw PythonMethodNotImplemented("AssociationMask", "associated_package_spec");
- }
-
- virtual char key() const
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("key"))
- return f();
- else
- throw PythonMethodNotImplemented("AssociationMask", "key");
- }
-
- virtual const std::string description() const
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("description"))
- return f();
- else
- throw PythonMethodNotImplemented("AssociationMask", "description");
- }
-};
-
-
void expose_mask()
{
/**
@@ -457,40 +416,5 @@ void expose_mask()
"A description of the mask."
)
;
-
- /**
- * AssociationMask
- */
- bp::register_ptr_to_python<std::shared_ptr<const AssociationMask> >();
- bp::implicitly_convertible<std::shared_ptr<AssociationMaskWrapper>, std::shared_ptr<Mask> >();
- bp::class_<AssociationMaskWrapper, std::shared_ptr<AssociationMaskWrapper>,
- bp::bases<Mask>, boost::noncopyable>
- (
- "AssociationMask",
- "An AssociationMask is a Mask that signifies that a PackageID is masked\n"
- "because of its association with another PackageID that is itself masked.\n\n"
-
- "This is used by old-style virtuals. If the provider of a virtual is\n"
- "masked then the virtual itself is masked by association.\n\n"
-
- "Can be subclassed in Python.",
- bp::init<>()
- )
- .def("associated_package_spec", bp::pure_virtual(&AssociationMask::associated_package_spec),
- "associated_package_spec() -> PackageDepSpec\n"
- "Fetch a spec for the associated package."
- )
-
- .def("key", bp::pure_virtual(&Mask::key),
- "key() -> string\n"
- "A single character key, which can be used by clients if they need\n"
- "a very compact way of representing a mask."
- )
-
- .def("description", bp::pure_virtual(&Mask::description),
- "description() -> string\n"
- "A description of the mask."
- )
- ;
}
diff --git a/python/mask_TEST.py b/python/mask_TEST.py
index e9f7221..83660b5 100755
--- a/python/mask_TEST.py
+++ b/python/mask_TEST.py
@@ -133,20 +133,6 @@ class TestCase_02_Masks_subclassing(unittest.TestCase):
test_unsupported_mask(TestUnsupportedMask())
- def test_05_association_mask(self):
- class TestAssociationMask(AssociationMask):
- def key(self):
- return "T"
-
- def description(self):
- return "test"
-
- def associated_package_spec(self):
- e = EnvironmentFactory.instance.create("")
- return parse_user_package_dep_spec("=masked/user-1.0", e, [])
-
- test_association_mask(TestAssociationMask())
-
if __name__ == "__main__":
unittest.main()
diff --git a/python/mask_TEST_setup.sh b/python/mask_TEST_setup.sh
index 681e988..f0d4939 100755
--- a/python/mask_TEST_setup.sh
+++ b/python/mask_TEST_setup.sh
@@ -23,10 +23,6 @@ USERLAND=test
KERNEL=test
END
-cat <<END > profiles/testprofile/virtuals
-virtual/association masked/repo
-END
-
cat <<"END" > masked/repo/repo-1.0.ebuild || exit 1
DESCRIPTION="RepositoryMask"
HOMEPAGE="http://paludis.pioto.org/"
diff --git a/ruby/mask.cc b/ruby/mask.cc
index 95b2a1a..a08a370 100644
--- a/ruby/mask.cc
+++ b/ruby/mask.cc
@@ -32,7 +32,6 @@ namespace
static VALUE c_unaccepted_mask;
static VALUE c_repository_mask;
static VALUE c_unsupported_mask;
- static VALUE c_association_mask;
static VALUE c_overridden_mask;
static VALUE c_mask_override_reason;
@@ -69,12 +68,6 @@ namespace
value = Data_Wrap_Struct(c_repository_mask, 0, &Common<std::shared_ptr<const Mask> >::free,
new std::shared_ptr<const Mask>(mm));
}
-
- void visit(const AssociationMask &)
- {
- value = Data_Wrap_Struct(c_association_mask, 0, &Common<std::shared_ptr<const Mask> >::free,
- new std::shared_ptr<const Mask>(mm));
- }
};
VALUE
@@ -159,21 +152,6 @@ namespace
/*
* call-seq:
- * associated_package_spec -> PackageDepSpec
- *
- * Fetch the associated package.
- */
- VALUE
- association_mask_associated_package(VALUE self)
- {
- std::shared_ptr<const Mask> * ptr;
- Data_Get_Struct(self, std::shared_ptr<const Mask>, ptr);
- std::shared_ptr<const AssociationMask> cast_ptr(std::static_pointer_cast<const AssociationMask>(*ptr));
- return package_dep_spec_to_value((cast_ptr)->associated_package_spec());
- }
-
- /*
- * call-seq:
* mask -> Mask
*/
VALUE
@@ -253,18 +231,6 @@ namespace
RUBY_FUNC_CAST((&MaskStringKey<UnsupportedMask,&UnsupportedMask::explanation>::fetch)), 0);
/*
- * Document-class: Paludis::AssociationMask
- *
- * An AssociationMask is a Mask that signifies that a PackageID is masked because of its association with
- * another PackageID that is itself masked.
- *
- * This is used by old-style virtuals. If the provider of a virtual is masked then the virtual itself is
- * masked by association.
- */
- c_association_mask = rb_define_class_under(paludis_module(), "AssociationMask", c_mask);
- rb_define_method(c_association_mask, "associated_package_spec", RUBY_FUNC_CAST(&association_mask_associated_package), 0);
-
- /*
* Document-class: Paludis::OverriddenMask
*
* An OverriddenMask holds a Mask and an explanation of why it has been overridden.
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 09abb2d..31c074a 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -1039,12 +1039,6 @@ namespace
{
cout << fuc(fs_masked_by_explanation(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()), fv<'x'>(m.explanation()));
}
-
- void visit(const AssociationMask & m) const
- {
- cout << fuc(fs_masked_by_explanation(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()),
- fv<'x'>("associated package '" + stringify(m.associated_package_spec()) + "'"));
- }
};
void display_masks(
diff --git a/src/clients/cave/cmd_print_id_masks.cc b/src/clients/cave/cmd_print_id_masks.cc
index b3d0260..4cc9227 100644
--- a/src/clients/cave/cmd_print_id_masks.cc
+++ b/src/clients/cave/cmd_print_id_masks.cc
@@ -122,11 +122,6 @@ namespace
{
return std::make_pair("", "");
}
-
- const std::pair<std::string, std::string> visit(const AssociationMask & m) const
- {
- return std::make_pair("", stringify(m.associated_package_spec()));
- }
};
void do_one_mask(
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index 5be5294..0c96c5d 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -105,7 +105,6 @@ namespace
("unaccepted", "masked by unaccepted key")
("repository", "masked by repository")
("unsupported", "masked because it is unsupported")
- ("association", "masked by association")
),
g_display_options(main_options_section(), "Display Options", "Controls the output format."),
a_format(&g_display_options, "format", 'f', "Select the output format. Special tokens recognised are "
@@ -223,16 +222,6 @@ namespace
break;
}
}
- else if (mask == "association")
- {
- for (PackageID::MasksConstIterator m((*i)->begin_masks()), m_end((*i)->end_masks()) ;
- m != m_end ; ++m)
- if (visitor_cast<const AssociationMask>(**m))
- {
- result->insert(*i);
- break;
- }
- }
else
throw args::DoHelp("Unknown --" + cmdline.a_with_mask.long_name() + " value '" + mask + "'");
}
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 8f1c3dc..7cdd054 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -1053,19 +1053,6 @@ namespace
);
}
- void visit(const AssociationMask & m)
- {
- out << fuc(
- (cmdline.a_raw_names.specified() ? fs_mask_value_raw() : fs_mask_value_human()),
- fv<'s'>(cmdline.a_raw_names.specified() ? stringify(m.key()) : "by " + m.description()),
- fv<'v'>(stringify(m.associated_package_spec())),
- fv<'t'>(""),
- fv<'i'>(std::string(indent, ' ')),
- fv<'b'>(""),
- fv<'p'>("")
- );
- }
-
void visit(const UserMask & m)
{
out << fuc(
diff --git a/zsh-completion/_cave b/zsh-completion/_cave
index 7067fa8..7dd5afe 100644
--- a/zsh-completion/_cave
+++ b/zsh-completion/_cave
@@ -555,7 +555,7 @@ _cave_cmd_print-ids()
'(--help -h)'{--help,-h}'[Display help messsage]' \
'*'{--matching,-m}'[Show only IDs matching this spec]:package spec: ' \
'*'{--supporting,-s}'[Show only IDs supporting this action]:supporting action:((install uninstall pretend config fetch pretend-fetch info))' \
- '(--with-mask -M)'{--with-mask,-M}'[Show only IDs with this kind of mask]:with mask:((none any user unaccepted repository unsupported association))' \
+ '(--with-mask -M)'{--with-mask,-M}'[Show only IDs with this kind of mask]:with mask:((none any user unaccepted repository unsupported))' \
'(--format -f)'{--format,-f}'[Select the output format]:output format: '
}