aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/fake/fake_repository.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-16 08:23:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-16 08:23:00 +0000
commitdc95c2f26ea490fce48575cd19b995d2b34297cf (patch)
treeecf718069b33a1ca5b0ba586ba3bd7f7bdfc09e4 /paludis/repositories/fake/fake_repository.cc
parent7385570bea9b9d1954edf7a824fa61bd42c371e8 (diff)
downloadpaludis-dc95c2f26ea490fce48575cd19b995d2b34297cf.tar.gz
paludis-dc95c2f26ea490fce48575cd19b995d2b34297cf.tar.xz
Replace RepositoryInfo with emtadata keys. Change how we handle ambiguous _imp. Introduce common Literal metadata key classes to reduce duplicated code. Fixes: ticket:438. Fixes: ticket:416
Diffstat (limited to 'paludis/repositories/fake/fake_repository.cc')
-rw-r--r--paludis/repositories/fake/fake_repository.cc26
1 files changed, 21 insertions, 5 deletions
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 4f1d3a49e..49c733ffc 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -27,6 +27,7 @@
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
+#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <map>
@@ -41,8 +42,12 @@ namespace paludis
tr1::shared_ptr<FakeRepository::VirtualsSequence> virtual_packages;
std::map<std::string, std::string> mirrors;
+ tr1::shared_ptr<const MetadataStringKey> format_key;
+
Implementation() :
- virtual_packages(new FakeRepository::VirtualsSequence)
+ virtual_packages(new FakeRepository::VirtualsSequence),
+ format_key(new LiteralMetadataStringKey(
+ "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/"));
@@ -53,7 +58,6 @@ namespace paludis
FakeRepository::FakeRepository(const Environment * const e, const RepositoryName & our_name) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
FakeRepositoryBase(e, our_name, RepositoryCapabilities::create()
- .installed_interface(0)
.sets_interface(this)
.syncable_interface(0)
.use_interface(this)
@@ -68,10 +72,10 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName
.make_virtuals_interface(0)
.qa_interface(0)
.hook_interface(0)
- .manifest_interface(0),
- "fake"),
- _imp(PrivateImplementationPattern<FakeRepository>::_imp.get())
+ .manifest_interface(0)),
+ _imp(PrivateImplementationPattern<FakeRepository>::_imp)
{
+ add_metadata_key(_imp->format_key);
}
FakeRepository::~FakeRepository()
@@ -167,3 +171,15 @@ FakeRepository::end_mirrors(const std::string & s) const
return MirrorsConstIterator(_imp->mirrors.equal_range(s).second);
}
+const tr1::shared_ptr<const MetadataStringKey>
+FakeRepository::format_key() const
+{
+ return _imp->format_key;
+}
+
+const tr1::shared_ptr<const MetadataFSEntryKey>
+FakeRepository::installed_root_key() const
+{
+ return tr1::shared_ptr<const MetadataFSEntryKey>();
+}
+