aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/fake
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-02 23:56:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-02 23:56:53 +0000
commitaaaaed580a954078e9b6f8b6aaf6b5337f8979ee (patch)
treee9f52649f48ec97c8aa8f05d0bf823511e0e7817 /paludis/repositories/fake
parent69fa594051d412e9e7de0041085974a3188612c2 (diff)
downloadpaludis-aaaaed580a954078e9b6f8b6aaf6b5337f8979ee.tar.gz
paludis-aaaaed580a954078e9b6f8b6aaf6b5337f8979ee.tar.xz
Split up dep spec heirarchies some more. Fixes: ticket:381
Diffstat (limited to 'paludis/repositories/fake')
-rw-r--r--paludis/repositories/fake/fake_package_id.cc65
-rw-r--r--paludis/repositories/fake/fake_package_id.hh25
2 files changed, 39 insertions, 51 deletions
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 054241741..2721a85f6 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -137,14 +137,14 @@ namespace paludis
};
template <>
- struct Implementation<FakeMetadataSpecTreeKey<URISpecTree> >
+ struct Implementation<FakeMetadataSpecTreeKey<FetchableURISpecTree> >
{
- tr1::shared_ptr<const URISpecTree::ConstItem> value;
+ tr1::shared_ptr<const FetchableURISpecTree::ConstItem> value;
std::string string_value;
- const tr1::function<const tr1::shared_ptr<const URISpecTree::ConstItem> (const std::string &)> func;
+ const tr1::function<const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> (const std::string &)> func;
tr1::shared_ptr<const URILabel> initial_label;
- Implementation(const tr1::function<const tr1::shared_ptr<const URISpecTree::ConstItem> (const std::string &)> & f) :
+ Implementation(const tr1::function<const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> (const std::string &)> & f) :
func(f),
initial_label(new URIListedThenMirrorsLabel("listed-then-mirrors"))
{
@@ -196,46 +196,47 @@ FakeMetadataSpecTreeKey<C_>::pretty_print_flat(const typename C_::Formatter &) c
return _imp->string_value;
}
-FakeMetadataSpecTreeKey<URISpecTree>::FakeMetadataSpecTreeKey(const std::string & r, const std::string & h, const std::string & v,
- const tr1::function<const tr1::shared_ptr<const URISpecTree::ConstItem> (const std::string &)> & f, const MetadataKeyType t) :
- MetadataSpecTreeKey<URISpecTree>(r, h, t),
- PrivateImplementationPattern<FakeMetadataSpecTreeKey<URISpecTree> >(new Implementation<FakeMetadataSpecTreeKey<URISpecTree> >(f)),
- _imp(PrivateImplementationPattern<FakeMetadataSpecTreeKey<URISpecTree> >::_imp.get())
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::FakeMetadataSpecTreeKey(const std::string & r, const std::string & h, const std::string & v,
+ const tr1::function<const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> (const std::string &)> & f, const MetadataKeyType t) :
+ MetadataSpecTreeKey<FetchableURISpecTree>(r, h, t),
+ PrivateImplementationPattern<FakeMetadataSpecTreeKey<FetchableURISpecTree> >(
+ new Implementation<FakeMetadataSpecTreeKey<FetchableURISpecTree> >(f)),
+ _imp(PrivateImplementationPattern<FakeMetadataSpecTreeKey<FetchableURISpecTree> >::_imp.get())
{
set_from_string(v);
}
-FakeMetadataSpecTreeKey<URISpecTree>::~FakeMetadataSpecTreeKey()
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::~FakeMetadataSpecTreeKey()
{
}
void
-FakeMetadataSpecTreeKey<URISpecTree>::set_from_string(const std::string & s)
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::set_from_string(const std::string & s)
{
_imp->string_value = s;
_imp->value = _imp->func(s);
}
-const tr1::shared_ptr<const URISpecTree::ConstItem>
-FakeMetadataSpecTreeKey<URISpecTree>::value() const
+const tr1::shared_ptr<const FetchableURISpecTree::ConstItem>
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::value() const
{
return _imp->value;
}
std::string
-FakeMetadataSpecTreeKey<URISpecTree>::pretty_print(const URISpecTree::Formatter &) const
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::pretty_print(const FetchableURISpecTree::Formatter &) const
{
return _imp->string_value;
}
std::string
-FakeMetadataSpecTreeKey<URISpecTree>::pretty_print_flat(const URISpecTree::Formatter &) const
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::pretty_print_flat(const FetchableURISpecTree::Formatter &) const
{
return _imp->string_value;
}
const tr1::shared_ptr<const URILabel>
-FakeMetadataSpecTreeKey<URISpecTree>::initial_label() const
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::initial_label() const
{
return _imp->initial_label;
}
@@ -339,9 +340,8 @@ namespace paludis
tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > post_dependencies;
tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies;
tr1::shared_ptr<FakeMetadataSpecTreeKey<RestrictSpecTree> > restrictions;
- tr1::shared_ptr<FakeMetadataSpecTreeKey<URISpecTree> > src_uri;
- tr1::shared_ptr<FakeMetadataSpecTreeKey<URISpecTree> > bin_uri;
- tr1::shared_ptr<FakeMetadataSpecTreeKey<URISpecTree> > homepage;
+ tr1::shared_ptr<FakeMetadataSpecTreeKey<FetchableURISpecTree> > src_uri;
+ tr1::shared_ptr<FakeMetadataSpecTreeKey<SimpleURISpecTree> > homepage;
mutable bool has_masks;
@@ -372,8 +372,8 @@ namespace paludis
suggested_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("SDEPEND", "Suggested dependencies",
"", tr1::bind(&erepository::parse_depend, _1,
*erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_dependencies)),
- src_uri(new FakeMetadataSpecTreeKey<URISpecTree>("SRC_URI", "Source URIs",
- "", tr1::bind(&erepository::parse_uri, _1,
+ src_uri(new FakeMetadataSpecTreeKey<FetchableURISpecTree>("SRC_URI", "Source URIs",
+ "", tr1::bind(&erepository::parse_fetchable_uri, _1,
*erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_dependencies)),
has_masks(false)
{
@@ -499,12 +499,6 @@ FakePackageID::suggested_dependencies_key() const
return _imp->suggested_dependencies;
}
-const tr1::shared_ptr<const MetadataSpecTreeKey<RestrictSpecTree> >
-FakePackageID::restrict_key() const
-{
- return _imp->restrictions;
-}
-
const tr1::shared_ptr<FakeMetadataKeywordSetKey>
FakePackageID::keywords_key()
{
@@ -547,30 +541,24 @@ FakePackageID::suggested_dependencies_key()
return _imp->suggested_dependencies;
}
-const tr1::shared_ptr<const MetadataSpecTreeKey<URISpecTree> >
+const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> >
FakePackageID::src_uri_key() const
{
return _imp->src_uri;
}
-const tr1::shared_ptr<FakeMetadataSpecTreeKey<URISpecTree> >
+const tr1::shared_ptr<FakeMetadataSpecTreeKey<FetchableURISpecTree> >
FakePackageID::src_uri_key()
{
return _imp->src_uri;
}
-const tr1::shared_ptr<const MetadataSpecTreeKey<URISpecTree> >
+const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> >
FakePackageID::homepage_key() const
{
return _imp->homepage;
}
-const tr1::shared_ptr<const MetadataSpecTreeKey<URISpecTree> >
-FakePackageID::bin_uri_key() const
-{
- return _imp->bin_uri;
-}
-
const tr1::shared_ptr<const MetadataStringKey>
FakePackageID::short_description_key() const
{
@@ -688,7 +676,7 @@ namespace
std::for_each(begin, end, accept_visitor(*this));
}
- void visit_leaf(const PlainTextDepSpec & spec)
+ void visit_leaf(const LicenseDepSpec & spec)
{
if (! (env->*func)(spec.text(), *id))
ok = false;
@@ -944,7 +932,8 @@ template class FakeMetadataSpecTreeKey<LicenseSpecTree>;
template class FakeMetadataSpecTreeKey<ProvideSpecTree>;
template class FakeMetadataSpecTreeKey<DependencySpecTree>;
template class FakeMetadataSpecTreeKey<RestrictSpecTree>;
-template class FakeMetadataSpecTreeKey<URISpecTree>;
+template class FakeMetadataSpecTreeKey<FetchableURISpecTree>;
+template class FakeMetadataSpecTreeKey<SimpleURISpecTree>;
template class FakeMetadataSetKey<KeywordNameSet>;
template class FakeMetadataSetKey<IUseFlagSet>;
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 152d12f95..2b407d899 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -106,27 +106,28 @@ namespace paludis
};
template <>
- class PALUDIS_VISIBLE FakeMetadataSpecTreeKey<URISpecTree> :
- public MetadataSpecTreeKey<URISpecTree>,
- private PrivateImplementationPattern<FakeMetadataSpecTreeKey<URISpecTree> >
+ class PALUDIS_VISIBLE FakeMetadataSpecTreeKey<FetchableURISpecTree> :
+ public MetadataSpecTreeKey<FetchableURISpecTree>,
+ private PrivateImplementationPattern<FakeMetadataSpecTreeKey<FetchableURISpecTree> >
{
private:
- Implementation<FakeMetadataSpecTreeKey<URISpecTree> > * const _imp;
+ Implementation<FakeMetadataSpecTreeKey<FetchableURISpecTree> > * const _imp;
public:
FakeMetadataSpecTreeKey(const std::string &, const std::string &, const std::string &,
- const tr1::function<const tr1::shared_ptr<const URISpecTree::ConstItem> (const std::string &)> &, const MetadataKeyType);
+ const tr1::function<const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> (const std::string &)> &,
+ const MetadataKeyType);
~FakeMetadataSpecTreeKey();
- virtual const tr1::shared_ptr<const URISpecTree::ConstItem> value() const
+ virtual const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
void set_from_string(const std::string &);
- virtual std::string pretty_print(const URISpecTree::Formatter &) const
+ virtual std::string pretty_print(const FetchableURISpecTree::Formatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::string pretty_print_flat(const URISpecTree::Formatter &) const
+ virtual std::string pretty_print_flat(const FetchableURISpecTree::Formatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const tr1::shared_ptr<const URILabel> initial_label() const
@@ -195,10 +196,8 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > post_dependencies_key() const;
virtual const tr1::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key() const;
- virtual const tr1::shared_ptr<const MetadataSpecTreeKey<URISpecTree> > src_uri_key() const;
- virtual const tr1::shared_ptr<const MetadataSpecTreeKey<URISpecTree> > bin_uri_key() const;
- virtual const tr1::shared_ptr<const MetadataSpecTreeKey<URISpecTree> > homepage_key() const;
- virtual const tr1::shared_ptr<const MetadataSpecTreeKey<RestrictSpecTree> > restrict_key() const;
+ virtual const tr1::shared_ptr<const MetadataSpecTreeKey<FetchableURISpecTree> > src_uri_key() const;
+ virtual const tr1::shared_ptr<const MetadataSpecTreeKey<SimpleURISpecTree> > homepage_key() const;
virtual const tr1::shared_ptr<const MetadataStringKey> short_description_key() const;
virtual const tr1::shared_ptr<const MetadataStringKey> long_description_key() const;
virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
@@ -217,7 +216,7 @@ namespace paludis
const tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > run_dependencies_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > post_dependencies_key();
const tr1::shared_ptr<FakeMetadataSpecTreeKey<DependencySpecTree> > suggested_dependencies_key();
- const tr1::shared_ptr<FakeMetadataSpecTreeKey<URISpecTree> > src_uri_key();
+ const tr1::shared_ptr<FakeMetadataSpecTreeKey<FetchableURISpecTree> > src_uri_key();
void set_slot(const SlotName &);