aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-26 21:02:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-26 21:02:30 +0000
commit8c38f206f44258bc6d0e30829a869fc474bdcb8f (patch)
tree8003b3f8dfe04a3d2caf8c869a4447000f187cdd
parentc8ac388f675660cfd7fa697bac51c4927d84dbf3 (diff)
downloadpaludis-8c38f206f44258bc6d0e30829a869fc474bdcb8f.tar.gz
paludis-8c38f206f44258bc6d0e30829a869fc474bdcb8f.tar.xz
Kill mirrors interface
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc2
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc1
-rw-r--r--paludis/repositories/cran/cran_repository.cc1
-rw-r--r--paludis/repositories/e/e_repository.cc37
-rw-r--r--paludis/repositories/e/e_repository.hh9
-rw-r--r--paludis/repositories/e/exndbam_repository.cc1
-rw-r--r--paludis/repositories/e/fetch_visitor.cc14
-rw-r--r--paludis/repositories/e/fetch_visitor.hh5
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc16
-rw-r--r--paludis/repositories/e/source_uri_finder.cc62
-rw-r--r--paludis/repositories/e/source_uri_finder.hh8
-rw-r--r--paludis/repositories/e/source_uri_finder_TEST.cc20
-rw-r--r--paludis/repositories/e/vdb_repository.cc1
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc1
-rw-r--r--paludis/repositories/fake/fake_repository.cc17
-rw-r--r--paludis/repositories/fake/fake_repository.hh10
-rw-r--r--paludis/repositories/gems/gems_repository.cc1
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc1
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc1
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc1
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc1
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc1
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc1
-rw-r--r--paludis/repository-fwd.hh1
-rw-r--r--paludis/repository.cc13
-rw-r--r--paludis/repository.hh34
-rw-r--r--python/repository.cc21
-rwxr-xr-xpython/repository_TEST.py4
-rw-r--r--ruby/repository.cc50
-rw-r--r--ruby/repository_TEST.rb29
31 files changed, 105 insertions, 260 deletions
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 57193b4..1a3a2aa 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -114,7 +114,6 @@ AccountsRepository::AccountsRepository(const AccountsRepositoryParams & p) :
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
@@ -133,7 +132,6 @@ AccountsRepository::AccountsRepository(const InstalledAccountsRepositoryParams &
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 95de78b..622cf40 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -167,7 +167,6 @@ CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryPa
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index ab5a857..c83387a 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -112,7 +112,6 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 4101f44..ac1d314 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -125,7 +125,7 @@ using namespace paludis::erepository;
typedef std::tr1::unordered_map<QualifiedPackageName,
std::list<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::tr1::shared_ptr<const RepositoryMaskInfo> > >,
Hash<QualifiedPackageName> > RepositoryMaskMap;
-typedef std::tr1::unordered_multimap<std::string, std::string, Hash<std::string> > MirrorMap;
+typedef std::tr1::unordered_map<std::string, std::tr1::shared_ptr<MirrorsSequence> > MirrorMap;
typedef std::tr1::unordered_map<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec>, Hash<QualifiedPackageName> > VirtualsMap;
typedef std::map<FSEntry, std::string> EAPIForFileMap;
@@ -487,7 +487,6 @@ ERepository::ERepository(const ERepositoryParams & p) :
value_for<n::environment_variable_interface>(this),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(this),
- value_for<n::mirrors_interface>(this),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>((*DistributionData::get_instance()->distribution_from_string(p.environment()->distribution())).support_old_style_virtuals() ? this : 0)
)),
@@ -695,9 +694,13 @@ ERepository::need_mirrors() const
std::random_shuffle(next(ee.begin()), ee.end(), r);
if (ee.size() > 6)
ee.resize(6);
+
+ std::tr1::shared_ptr<MirrorsSequence> ms(new MirrorsSequence);
for (std::vector<std::string>::const_iterator e(next(ee.begin())),
e_end(ee.end()) ; e != e_end ; ++e)
- _imp->mirrors.insert(std::make_pair(ee.at(0), *e));
+ ms->push_back(*e);
+
+ _imp->mirrors.insert(std::make_pair(ee.at(0), ms));
}
}
}
@@ -878,20 +881,6 @@ ERepository::profile_variable(const std::string & s) const
return _imp->profile_ptr->environment_variable(s);
}
-ERepository::MirrorsConstIterator
-ERepository::begin_mirrors(const std::string & s) const
-{
- need_mirrors();
- return MirrorsConstIterator(_imp->mirrors.equal_range(s).first);
-}
-
-ERepository::MirrorsConstIterator
-ERepository::end_mirrors(const std::string & s) const
-{
- need_mirrors();
- return MirrorsConstIterator(_imp->mirrors.equal_range(s).second);
-}
-
std::tr1::shared_ptr<const ERepository::VirtualsSequence>
ERepository::virtual_packages() const
{
@@ -1859,6 +1848,16 @@ namespace
return true;
}
+
+ const std::tr1::shared_ptr<const MirrorsSequence>
+ get_mirrors_fn(const std::string & m, const MirrorMap & map)
+ {
+ MirrorMap::const_iterator i(map.find(m));
+ if (i == map.end())
+ return make_shared_ptr(new MirrorsSequence);
+ else
+ return i->second;
+ }
}
void
@@ -1961,11 +1960,13 @@ ERepository::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
if (fetch_action.options.fetch_parts()[fp_regulars] && ! fetch_action.options.ignore_unfetched())
{
+ need_mirrors();
+
FetchVisitor f(_imp->params.environment(), id, *id->eapi(),
_imp->params.distdir(), fetch_action.options.fetch_parts()[fp_unneeded],
fetch_userpriv_ok, mirrors_name,
id->fetches_key()->initial_label(), fetch_action.options.safe_resume(),
- output_manager);
+ output_manager, std::tr1::bind(&get_mirrors_fn, std::tr1::placeholders::_1, std::tr1::cref(_imp->mirrors)));
id->fetches_key()->value()->root()->accept(f);
}
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index de1faeb..28fd728 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -52,7 +52,6 @@ namespace paludis
class PALUDIS_VISIBLE ERepository :
public Repository,
public RepositoryEnvironmentVariableInterface,
- public RepositoryMirrorsInterface,
public RepositoryVirtualsInterface,
public RepositoryDestinationInterface,
public RepositoryManifestInterface,
@@ -87,14 +86,6 @@ namespace paludis
virtual void purge_invalid_cache() const;
- /* RepositoryMirrorsInterface */
-
- virtual MirrorsConstIterator begin_mirrors(const std::string & s) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual MirrorsConstIterator end_mirrors(const std::string & s) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
/* RepositoryVirtualsInterface */
virtual std::tr1::shared_ptr<const VirtualsSequence> virtual_packages() const
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 97445df..f1d9213 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -107,7 +107,6 @@ ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepo
value_for<n::environment_variable_interface>(this),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 8aeec28..55aff11 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -56,6 +56,7 @@ namespace paludis
std::tr1::shared_ptr<const URILabel> default_label;
const bool safe_resume;
const std::tr1::shared_ptr<OutputManager> output_manager;
+ const GetMirrorsFunction get_mirrors_fn;
std::list<const URILabel *> labels;
@@ -69,7 +70,8 @@ namespace paludis
const std::string & m,
const std::tr1::shared_ptr<const URILabel> & n,
const bool sr,
- const std::tr1::shared_ptr<OutputManager> & md) :
+ const std::tr1::shared_ptr<OutputManager> & md,
+ const GetMirrorsFunction & g) :
env(e),
id(i),
eapi(p),
@@ -79,7 +81,8 @@ namespace paludis
mirrors_name(m),
default_label(n),
safe_resume(sr),
- output_manager(md)
+ output_manager(md),
+ get_mirrors_fn(g)
{
labels.push_front(default_label.get());
}
@@ -96,8 +99,9 @@ FetchVisitor::FetchVisitor(
const std::string & m,
const std::tr1::shared_ptr<const URILabel> & n,
const bool sr,
- const std::tr1::shared_ptr<OutputManager> & md) :
- PrivateImplementationPattern<FetchVisitor>(new Implementation<FetchVisitor>(e, i, p, d, f, u, m, n, sr, md))
+ const std::tr1::shared_ptr<OutputManager> & md,
+ const GetMirrorsFunction & g) :
+ PrivateImplementationPattern<FetchVisitor>(new Implementation<FetchVisitor>(e, i, p, d, f, u, m, n, sr, md, g))
{
}
@@ -151,7 +155,7 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::T
throw ActionFailedError("No fetch action label available");
SourceURIFinder source_uri_finder(_imp->env, _imp->id->repository().get(),
- node.spec()->original_url(), node.spec()->filename(), _imp->mirrors_name);
+ node.spec()->original_url(), node.spec()->filename(), _imp->mirrors_name, _imp->get_mirrors_fn);
(*_imp->labels.begin())->accept(source_uri_finder);
for (SourceURIFinder::ConstIterator i(source_uri_finder.begin()), i_end(source_uri_finder.end()) ;
i != i_end ; ++i)
diff --git a/paludis/repositories/e/fetch_visitor.hh b/paludis/repositories/e/fetch_visitor.hh
index a62799c..4cf47a9 100644
--- a/paludis/repositories/e/fetch_visitor.hh
+++ b/paludis/repositories/e/fetch_visitor.hh
@@ -36,6 +36,8 @@ namespace paludis
{
namespace erepository
{
+ typedef std::tr1::function<std::tr1::shared_ptr<const MirrorsSequence> (const std::string &)> GetMirrorsFunction;
+
class PALUDIS_VISIBLE FetchVisitor :
private PrivateImplementationPattern<FetchVisitor>
{
@@ -50,7 +52,8 @@ namespace paludis
const std::string & mirrors_name,
const std::tr1::shared_ptr<const URILabel> & initial_label,
const bool safe_resume,
- const std::tr1::shared_ptr<OutputManager> &);
+ const std::tr1::shared_ptr<OutputManager> &,
+ const GetMirrorsFunction &);
~FetchVisitor();
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 3f47a3d..c92a148 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -42,6 +42,20 @@ using namespace test;
using namespace paludis;
using namespace paludis::erepository;
+namespace
+{
+ const std::tr1::shared_ptr<const MirrorsSequence>
+ get_mirrors_fn(const std::string & m)
+ {
+ const std::tr1::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ if (m == "repo")
+ result->push_back("http://fake-repo/fake-repo/");
+ if (m == "example")
+ result->push_back("http://fake-example/fake-example/");
+ return result;
+ }
+}
+
namespace test_cases
{
struct FetchVisitorTest : TestCase
@@ -67,7 +81,7 @@ namespace test_cases
&env, UserPackageDepSpecOptions()), MatchPackageOptions()))]->begin(),
*eapi, FSEntry("fetch_visitor_TEST_dir/out"),
false, false, "test", make_shared_ptr(new URIListedThenMirrorsLabel("listed-then-mirrors")), false,
- make_shared_ptr(new StandardOutputManager));
+ make_shared_ptr(new StandardOutputManager), get_mirrors_fn);
parse_fetchable_uri("file:///" + stringify(FSEntry("fetch_visitor_TEST_dir/in/input1").realpath()), &env, id, *eapi)->root()->accept(v);
TEST_CHECK(FSEntry("fetch_visitor_TEST_dir/out/input1").is_regular_file());
diff --git a/paludis/repositories/e/source_uri_finder.cc b/paludis/repositories/e/source_uri_finder.cc
index 086ef97..a887b25 100644
--- a/paludis/repositories/e/source_uri_finder.cc
+++ b/paludis/repositories/e/source_uri_finder.cc
@@ -42,24 +42,26 @@ namespace paludis
const std::string url;
const std::string filename;
const std::string mirrors_name;
+ const GetMirrorsFunction get_mirrors_fn;
std::list<std::pair<std::string, std::string> > items;
Implementation(const Environment * const e, const Repository * const r, const std::string & u, const std::string & f,
- const std::string & m) :
+ const std::string & m, const GetMirrorsFunction & g) :
env(e),
repo(r),
url(u),
filename(f),
- mirrors_name(m)
+ mirrors_name(m),
+ get_mirrors_fn(g)
{
}
};
}
SourceURIFinder::SourceURIFinder(const Environment * const e, const Repository * const repo,
- const std::string & u, const std::string & f, const std::string & m) :
- PrivateImplementationPattern<SourceURIFinder>(new Implementation<SourceURIFinder>(e, repo, u, f, m))
+ const std::string & u, const std::string & f, const std::string & m, const GetMirrorsFunction & g) :
+ PrivateImplementationPattern<SourceURIFinder>(new Implementation<SourceURIFinder>(e, repo, u, f, m, g))
{
}
@@ -147,28 +149,28 @@ SourceURIFinder::add_mirrors()
{
Context context("When adding repository mirrors from '" + _imp->mirrors_name + "':");
- std::tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->env->mirrors(_imp->mirrors_name));
- if (mirrors->empty())
- Log::get_instance()->message("e.source_uri_finder.no_mirrors", ll_debug, lc_context) << "Environment mirrors set is empty";
-
- for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
{
- Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
- << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
- _imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + _imp->filename, _imp->filename));
+ std::tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->env->mirrors(_imp->mirrors_name));
+ if (mirrors->empty())
+ Log::get_instance()->message("e.source_uri_finder.no_mirrors", ll_debug, lc_context) << "Environment mirrors set is empty";
+
+ for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
+ {
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
+ _imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + _imp->filename, _imp->filename));
+ }
}
{
Context local_context("When adding repository mirrors '" + _imp->mirrors_name + "':");
- if ((*_imp->repo).mirrors_interface())
- for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo).mirrors_interface()->begin_mirrors(_imp->mirrors_name)),
- m_end((*_imp->repo).mirrors_interface()->end_mirrors(_imp->mirrors_name)) ;
- m != m_end ; ++m)
- {
- Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
- << "Adding " << strip_trailing(m->second, "/") << "/" << _imp->filename;
- _imp->items.push_back(std::make_pair(strip_trailing(m->second, "/") + "/" + _imp->filename, _imp->filename));
- }
+ std::tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->get_mirrors_fn(_imp->mirrors_name));
+ for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
+ {
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(*m, "/") << "/" << _imp->filename;
+ _imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + _imp->filename, _imp->filename));
+ }
}
}
@@ -201,16 +203,14 @@ SourceURIFinder::add_listed()
{
Context local_context("When adding from repository for listed mirror '" + mirror + "':");
- if ((*_imp->repo).mirrors_interface())
- for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo).mirrors_interface()->begin_mirrors(mirror)),
- m_end((*_imp->repo).mirrors_interface()->end_mirrors(mirror)) ;
- m != m_end ; ++m)
- {
- Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
- << "Adding " << strip_trailing(m->second, "/")
- << "/" << original_name;
- _imp->items.push_back(std::make_pair(strip_trailing(m->second, "/") + "/" + original_name, _imp->filename));
- }
+ std::tr1::shared_ptr<const MirrorsSequence> mirrors(_imp->get_mirrors_fn(mirror));
+ for (MirrorsSequence::ConstIterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
+ {
+ Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
+ << "Adding " << strip_trailing(*m, "/")
+ << "/" << original_name;
+ _imp->items.push_back(std::make_pair(strip_trailing(*m, "/") + "/" + original_name, _imp->filename));
+ }
}
}
else
diff --git a/paludis/repositories/e/source_uri_finder.hh b/paludis/repositories/e/source_uri_finder.hh
index 8b8fbd5..8f0f91f 100644
--- a/paludis/repositories/e/source_uri_finder.hh
+++ b/paludis/repositories/e/source_uri_finder.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * 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
@@ -26,11 +26,14 @@
#include <paludis/dep_label.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/repository-fwd.hh>
+#include <tr1/functional>
namespace paludis
{
namespace erepository
{
+ typedef std::tr1::function<std::tr1::shared_ptr<const MirrorsSequence> (const std::string &)> GetMirrorsFunction;
+
class PALUDIS_VISIBLE SourceURIFinder :
private PrivateImplementationPattern<SourceURIFinder>
{
@@ -44,7 +47,8 @@ namespace paludis
const Repository * const repo,
const std::string & url,
const std::string & filename,
- const std::string & mirrors_name);
+ const std::string & mirrors_name,
+ const GetMirrorsFunction & fn);
~SourceURIFinder();
diff --git a/paludis/repositories/e/source_uri_finder_TEST.cc b/paludis/repositories/e/source_uri_finder_TEST.cc
index f02bdde..bec0d8c 100644
--- a/paludis/repositories/e/source_uri_finder_TEST.cc
+++ b/paludis/repositories/e/source_uri_finder_TEST.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/package_database.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
@@ -30,6 +31,20 @@ using namespace test;
using namespace paludis;
using namespace paludis::erepository;
+namespace
+{
+ const std::tr1::shared_ptr<MirrorsSequence>
+ get_mirrors_fn(const std::string & m)
+ {
+ const std::tr1::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ if (m == "example")
+ result->push_back("http://fake-example/fake-example/");
+ if (m == "repo")
+ result->push_back("http://fake-repo/fake-repo/");
+ return result;
+ }
+}
+
namespace test_cases
{
struct SourceURIFinderTest : TestCase
@@ -45,7 +60,8 @@ namespace test_cases
)));
env.package_database()->add_repository(1, repo);
- SourceURIFinder f(&env, repo.get(), "http://example.com/path/input", "output", "monkey");
+ SourceURIFinder f(&env, repo.get(), "http://example.com/path/input", "output", "monkey",
+ get_mirrors_fn);
URIMirrorsThenListedLabel label("mirrors-then-listed");
label.accept(f);
@@ -74,7 +90,7 @@ namespace test_cases
)));
env.package_database()->add_repository(1, repo);
- SourceURIFinder f(&env, repo.get(), "mirror://example/path/input", "output", "repo");
+ SourceURIFinder f(&env, repo.get(), "mirror://example/path/input", "output", "repo", get_mirrors_fn);
URIMirrorsThenListedLabel label("mirrors-then-listed");
label.accept(f);
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index ff11d86..f738e13 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -168,7 +168,6 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
value_for<n::environment_variable_interface>(this),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(this),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 16b6e4b..afd58ca 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -62,7 +62,6 @@ FakeInstalledRepository::FakeInstalledRepository(const FakeInstalledRepositoryPa
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(this),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index fc38ae2..e2da441 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -41,8 +41,6 @@ namespace paludis
struct Implementation<FakeRepository>
{
std::tr1::shared_ptr<FakeRepository::VirtualsSequence> virtual_packages;
- std::map<std::string, std::string> mirrors;
-
std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation() :
@@ -50,8 +48,6 @@ namespace paludis
format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "fake"))
{
- mirrors.insert(std::make_pair("example", "http://fake-example/fake-example/"));
- mirrors.insert(std::make_pair("repo", "http://fake-repo/fake-repo/"));
}
};
}
@@ -63,7 +59,6 @@ FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(this),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>((*DistributionData::get_instance()->distribution_from_string(
params.environment()->distribution())).support_old_style_virtuals() ? this : 0)
@@ -145,18 +140,6 @@ FakeRepository::some_ids_might_support_action(const SupportsActionTestBase & a)
return a.accept_returning<bool>(q);
}
-FakeRepository::MirrorsConstIterator
-FakeRepository::begin_mirrors(const std::string & s) const
-{
- return MirrorsConstIterator(_imp->mirrors.equal_range(s).first);
-}
-
-FakeRepository::MirrorsConstIterator
-FakeRepository::end_mirrors(const std::string & s) const
-{
- return MirrorsConstIterator(_imp->mirrors.equal_range(s).second);
-}
-
const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
FakeRepository::format_key() const
{
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index 8bd44f3..a768d30 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -53,8 +53,7 @@ namespace paludis
class PALUDIS_VISIBLE FakeRepository :
private PrivateImplementationPattern<FakeRepository>,
public FakeRepositoryBase,
- public RepositoryVirtualsInterface,
- public RepositoryMirrorsInterface
+ public RepositoryVirtualsInterface
{
private:
PrivateImplementationPattern<FakeRepository>::ImpPtr & _imp;
@@ -80,13 +79,6 @@ namespace paludis
virtual std::tr1::shared_ptr<const VirtualsSequence> virtual_packages() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- /* RepositoryMirrorsInterface */
-
- virtual MirrorsConstIterator begin_mirrors(const std::string & s) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual MirrorsConstIterator end_mirrors(const std::string & s) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
/* Keys */
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index efc4b9f..fc9badc 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -96,7 +96,6 @@ GemsRepository::GemsRepository(const gems::RepositoryParams & params) :
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 1066ac3..93d5989 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -100,7 +100,6 @@ InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepository
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 9bf12fe..c5ad42a 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -90,7 +90,6 @@ UnavailableRepository::UnavailableRepository(const UnavailableRepositoryParams &
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 61e65bd..d660826 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -95,7 +95,6 @@ InstalledUnpackagedRepository::InstalledUnpackagedRepository(
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index aa550ff..320128f 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -100,7 +100,6 @@ UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 910f8f4..e30a325 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -90,7 +90,6 @@ UnwrittenRepository::UnwrittenRepository(const UnwrittenRepositoryParams & p) :
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 3ddba4f..776cff4 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -114,7 +114,6 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 49ef786..a4ef5a7 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -126,7 +126,6 @@ VirtualsRepository::VirtualsRepository(const Environment * const env) :
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(this),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
- value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
)),
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index 0c4ef3d..22758c8 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -40,7 +40,6 @@ namespace paludis
class Repository;
class RepositoryEnvironmentVariableInterface;
- class RepositoryMirrorsInterface;
class RepositoryProvidesInterface;
class RepositoryVirtualsInterface;
class RepositoryMakeVirtualsInterface;
diff --git a/paludis/repository.cc b/paludis/repository.cc
index d14abb2..98c633d 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -55,9 +55,6 @@ template class Sequence<RepositoryProvidesEntry>;
template class WrappedForwardIterator<Sequence<RepositoryProvidesEntry>::ConstIteratorTag, const RepositoryProvidesEntry>;
template class WrappedOutputIterator<Sequence<RepositoryProvidesEntry>::InserterTag, RepositoryProvidesEntry>;
-template class WrappedForwardIterator<RepositoryMirrorsInterface::MirrorsConstIteratorTag,
- const std::pair<const std::string, std::string> >;
-
NoSuchSetError::NoSuchSetError(const std::string & our_name) throw () :
Exception("Could not find '" + our_name + "'"),
_name(our_name)
@@ -187,10 +184,6 @@ RepositoryEnvironmentVariableInterface::~RepositoryEnvironmentVariableInterface(
{
}
-RepositoryMirrorsInterface::~RepositoryMirrorsInterface()
-{
-}
-
RepositoryProvidesInterface::~RepositoryProvidesInterface()
{
}
@@ -212,12 +205,6 @@ RepositoryManifestInterface::~RepositoryManifestInterface()
}
bool
-RepositoryMirrorsInterface::is_mirror(const std::string & s) const
-{
- return begin_mirrors(s) != end_mirrors(s);
-}
-
-bool
Repository::can_be_favourite_repository() const
{
return some_ids_might_support_action(SupportsActionTest<InstallAction>());
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 516bf3e..4ad9ac1 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -63,7 +63,6 @@ namespace paludis
struct make_virtuals_interface;
struct manifest_interface;
struct merged_entries;
- struct mirrors_interface;
struct options;
struct output_manager;
struct package_id;
@@ -92,7 +91,6 @@ namespace paludis
NamedValue<n::environment_variable_interface, RepositoryEnvironmentVariableInterface *> environment_variable_interface;
NamedValue<n::make_virtuals_interface, RepositoryMakeVirtualsInterface *> make_virtuals_interface;
NamedValue<n::manifest_interface, RepositoryManifestInterface *> manifest_interface;
- NamedValue<n::mirrors_interface, RepositoryMirrorsInterface *> mirrors_interface;
NamedValue<n::provides_interface, RepositoryProvidesInterface *> provides_interface;
NamedValue<n::virtuals_interface, RepositoryVirtualsInterface *> virtuals_interface;
};
@@ -450,38 +448,6 @@ namespace paludis
};
/**
- * Interface for mirror querying for repositories.
- *
- * \see Repository
- * \ingroup g_repository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE RepositoryMirrorsInterface
- {
- public:
- ///\name Iterate over our mirrors
- ///\{
-
- struct MirrorsConstIteratorTag;
- typedef WrappedForwardIterator<MirrorsConstIteratorTag,
- const std::pair<const std::string, std::string> > MirrorsConstIterator;
-
- virtual MirrorsConstIterator begin_mirrors(const std::string & s) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual MirrorsConstIterator end_mirrors(const std::string & s) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Is the named item a mirror?
- */
- bool is_mirror(const std::string & s) const;
-
- ///\}
-
- virtual ~RepositoryMirrorsInterface();
- };
-
- /**
* Interface for repositories that define virtuals.
*
* \see Repository
diff --git a/python/repository.cc b/python/repository.cc
index 661b238..0ca595e 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -39,12 +39,6 @@ struct RepositoryWrapper :
Repository,
bp::wrapper<Repository>
{
- static RepositoryMirrorsInterface *
- get_mirrors_interface(const Repository & self)
- {
- return self.mirrors_interface();
- }
-
static RepositoryEnvironmentVariableInterface *
get_environment_variable_interface(const Repository & self)
{
@@ -192,11 +186,6 @@ void expose_repository()
"[ro] RepositoryEnvironmentInterface"
)
- .add_property("mirrors_interface", bp::make_function(&RepositoryWrapper::get_mirrors_interface,
- bp::return_internal_reference<>()),
- "[ro] RepositoryMirrorsInterface"
- )
-
.add_property("virtuals_interface", bp::make_function(&RepositoryWrapper::get_virtuals_interface,
bp::return_internal_reference<>()),
"[ro] RepositoryVirtualsInterface"
@@ -248,16 +237,6 @@ void expose_repository()
);
/**
- * RepositoryMirrorsInterface
- */
- bp::class_<RepositoryMirrorsInterface, boost::noncopyable>
- (
- "RepositoryMirrorsInterface",
- "Interface for mirror querying for repositories.",
- bp::no_init
- );
-
- /**
* RepositoryVirtualsInterface
*/
bp::class_<RepositoryVirtualsInterface, boost::noncopyable>
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index 52e44cf..35b64be 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -111,10 +111,6 @@ class TestCase_02_RepositoryInterfaces(unittest.TestCase):
evi = repo.environment_variable_interface
self.assert_(isinstance(evi, RepositoryEnvironmentVariableInterface))
- def test_07_mirrors_interface(self):
- mi = repo.mirrors_interface
- self.assert_(isinstance(mi, RepositoryMirrorsInterface))
-
def test_08_provides_interface(self):
pi = irepo.provides_interface
self.assert_(isinstance(pi, RepositoryProvidesInterface))
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 1c26e16..a736bd0 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -320,14 +320,6 @@ namespace
* Returns self if the repository supports the interface, otherwise Nil.
*/
/*
- * Document-method: mirrors_interface
- *
- * call-seq:
- * mirrors_interface -> self or Nil
- *
- * Returns self if the repository supports the interface, otherwise Nil.
- */
- /*
* Document-method: environment_variable_interface
*
* call-seq:
@@ -618,43 +610,6 @@ namespace
return Qnil;
}
- /*
- * call-seq:
- * is_mirror?(mirror_name) -> true or false
- *
- * Is the named item a mirror?
- */
- VALUE
- repository_is_mirror(VALUE self, VALUE mirror)
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if ((**self_ptr).mirrors_interface())
- return (**self_ptr).mirrors_interface()->is_mirror(StringValuePtr(mirror)) ? Qtrue : Qfalse;
- return Qnil;
- }
-
- /*
- * call-seq:
- * mirrors(mirror_name) -> Array
- *
- * Return the mirror URI prefixes for a named mirror.
- */
- VALUE
- repository_mirrors(VALUE self, VALUE mirror)
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if (!(**self_ptr).mirrors_interface())
- return Qnil;
- VALUE result(rb_ary_new());
- for (RepositoryMirrorsInterface::MirrorsConstIterator m((**self_ptr).mirrors_interface()->begin_mirrors(StringValuePtr(mirror))),
- m_end((**self_ptr).mirrors_interface()->end_mirrors(StringValuePtr(mirror))) ;
- m != m_end ; ++m)
- rb_ary_push(result, rb_str_new2((m->second).c_str()));
- return result;
- }
-
void do_register_repository()
{
/*
@@ -675,8 +630,6 @@ namespace
rb_define_method(c_repository, "package_names", RUBY_FUNC_CAST(&repository_package_names), 1);
rb_define_method(c_repository, "package_ids", RUBY_FUNC_CAST(&repository_package_ids), 1);
- rb_define_method(c_repository, "mirrors_interface", RUBY_FUNC_CAST((&Interface<
- n::mirrors_interface, RepositoryMirrorsInterface, &Repository::mirrors_interface>::fetch)), 0);
rb_define_method(c_repository, "environment_variable_interface", RUBY_FUNC_CAST((&Interface<
n::environment_variable_interface, RepositoryEnvironmentVariableInterface, &Repository::environment_variable_interface>::fetch)), 0);
rb_define_method(c_repository, "provides_interface", RUBY_FUNC_CAST((&Interface<
@@ -695,9 +648,6 @@ namespace
RUBY_FUNC_CAST((&RepositoryKey<MetadataValueKey<FSEntry>, &Repository::installed_root_key>::fetch)), 0);
rb_define_method(c_repository, "get_environment_variable", RUBY_FUNC_CAST(&repository_get_environment_variable), 2);
- rb_define_method(c_repository, "is_mirror?", RUBY_FUNC_CAST(&repository_is_mirror), 1);
- rb_define_method(c_repository, "mirrors", RUBY_FUNC_CAST(&repository_mirrors), 1);
-
/*
* Document-class: Paludis::FakeRepositoryBase
*
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 4d3f8a5..fb79348 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -166,7 +166,7 @@ module Paludis
def test_responds
repo = no_config_testrepo.main_repository
[
- :mirrors_interface, :environment_variable_interface,
+ :environment_variable_interface,
:provides_interface, :virtuals_interface].each do |sym|
assert_respond_to repo, sym
end
@@ -174,7 +174,7 @@ module Paludis
def test_interfaces
assert_equal installed_repo.name, installed_repo.provides_interface.name
- assert_nil installed_repo.mirrors_interface
+ assert_nil installed_repo.virtuals_interface
end
def text_repository_environment_interface
@@ -229,31 +229,6 @@ module Paludis
end
end
- class TestCase_RepositoryMirrorsInterface < Test::Unit::TestCase
- include RepositoryTestCase
-
- def test_responds
- repo = no_config_testrepo.main_repository
- [:is_mirror?, :mirrors].each do |sym|
- assert_respond_to repo, sym
- end
- end
-
- def test_is_mirror?
- repo = no_config_testrepo.main_repository
- assert repo.is_mirror?('cat')
- assert !repo.is_mirror?('dog')
- end
-
- def test_mirrors
- cat_mirrors = repo.mirrors('cat')
- assert_equal 2, cat_mirrors.length
- assert cat_mirrors.include?('http://a')
- assert cat_mirrors.include?('http://b')
- assert repo.mirrors('dog').empty?
- end
- end
-
class TestCase_RepositorySomeIdsMightSupport < Test::Unit::TestCase
include RepositoryTestCase