aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-08 14:01:22 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-08 15:58:17 +0000
commit71037b419832743996620c47fb91bb87206b61c9 (patch)
tree808040bd7948596137eea549e92f8cce6818c3a0
parenta7d1a3d9a271be81af6b01ef310147fd2aa35c94 (diff)
downloadpaludis-71037b419832743996620c47fb91bb87206b61c9.tar.gz
paludis-71037b419832743996620c47fb91bb87206b61c9.tar.xz
Support multiple syncers
-rw-r--r--paludis/repositories/cran/cran_repository.cc34
-rw-r--r--paludis/repositories/cran/cran_repository.hh2
-rw-r--r--paludis/repositories/e/e_repository.cc32
-rw-r--r--paludis/repositories/e/e_repository_params.hh5
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc31
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_TEST.cc9
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc32
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_TEST.cc9
10 files changed, 98 insertions, 64 deletions
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 1bf2028..8e84671 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -81,7 +81,7 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
std::shared_ptr<const MetadataValueKey<FSPath> > library_key;
- std::shared_ptr<const MetadataValueKey<std::string> > sync_key;
+ std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_key;
std::shared_ptr<Map<std::string, std::string> > sync_hosts;
std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key;
};
@@ -96,11 +96,13 @@ Imp<CRANRepository>::Imp(const CRANRepositoryParams & p, const std::shared_ptr<M
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "cran")),
builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("builddir", "builddir", mkt_normal, params.builddir())),
library_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("library", "library", mkt_normal, params.library())),
- sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync", "sync", mkt_normal, params.sync())),
+ sync_key(std::make_shared<LiteralMetadataStringStringMapKey>("sync", "sync", mkt_normal, params.sync())),
sync_hosts(std::make_shared<Map<std::string, std::string> >()),
sync_host_key(std::make_shared<LiteralMetadataStringStringMapKey>("sync_host", "sync_host", mkt_internal, sync_hosts))
{
- sync_hosts->insert("", extract_host_from_url(params.sync()));
+ for (auto i(params.sync()->begin()), i_end(params.sync()->end()) ;
+ i != i_end ; ++i)
+ sync_hosts->insert(i->first, extract_host_from_url(i->second));
}
Imp<CRANRepository>::~Imp()
@@ -348,14 +350,18 @@ CRANRepository::sync(
const std::string & suffix,
const std::shared_ptr<OutputManager> & output_manager) const
{
- if (! suffix.empty())
+ std::string sync_uri;
+ if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix))
+ sync_uri = _imp->params.sync()->find(suffix)->second;
+
+ if (sync_uri.empty())
return false;
Context context("When syncing repository '" + stringify(name()) + "':");
Lock l(*_imp->big_nasty_mutex);
std::string cmd("rsync --delete --recursive --progress --exclude \"*.html\" --exclude \"*.INDEX\" '" +
- _imp->params.sync() + "/src/contrib/Descriptions/' ./");
+ sync_uri + "/src/contrib/Descriptions/' ./");
Process command1((ProcessCommand(cmd)));
command1.chdir(_imp->params.location());
@@ -367,9 +373,9 @@ CRANRepository::sync(
;
if (0 != command1.run().wait())
- throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
+ throw SyncFailedError(stringify(_imp->params.location()), sync_uri);
- cmd = "rsync --progress '" + _imp->params.sync() + "/src/contrib/PACKAGES' ./";
+ cmd = "rsync --progress '" + sync_uri + "/src/contrib/PACKAGES' ./";
Process command2((ProcessCommand(cmd)));
command2.chdir(_imp->params.location());
@@ -381,9 +387,9 @@ CRANRepository::sync(
;
if (0 != command2.run().wait())
- throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
+ throw SyncFailedError(stringify(_imp->params.location()), sync_uri);
- cmd = "rsync --progress '" + _imp->params.sync() + "/CRAN_mirrors.csv' ./";
+ cmd = "rsync --progress '" + sync_uri + "/CRAN_mirrors.csv' ./";
Process command3((ProcessCommand(cmd)));
command3.chdir(_imp->params.location());
@@ -395,7 +401,7 @@ CRANRepository::sync(
;
if (0 != command3.run().wait())
- throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
+ throw SyncFailedError(stringify(_imp->params.location()), sync_uri);
return true;
}
@@ -423,9 +429,11 @@ CRANRepository::repository_factory_create(
if (mirror.empty())
mirror = "http://cran.r-project.org/";
- std::string sync(f("sync"));
- if (sync.empty())
- sync = "rsync://cran.r-project.org/CRAN";
+ auto sync(std::make_shared<Map<std::string, std::string> >());
+ std::string empty_sync(f("sync"));
+ if (empty_sync.empty())
+ empty_sync = "rsync://cran.r-project.org/CRAN";
+ sync->insert("", empty_sync);
std::string builddir(f("builddir"));
if (builddir.empty())
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 5695f2b..acc7ec9 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -63,7 +63,7 @@ namespace paludis
NamedValue<n::library, FSPath> library;
NamedValue<n::location, FSPath> location;
NamedValue<n::mirror, std::string> mirror;
- NamedValue<n::sync, std::string> sync;
+ NamedValue<n::sync, std::shared_ptr<Map<std::string, std::string> > > sync;
};
/**
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 612cc0f..5ddd4c8 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -255,8 +255,8 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<FSPath> > securitydir_key;
std::shared_ptr<const MetadataValueKey<FSPath> > setsdir_key;
std::shared_ptr<const MetadataValueKey<FSPath> > newsdir_key;
- std::shared_ptr<const MetadataValueKey<std::string> > sync_key;
- std::shared_ptr<const MetadataValueKey<std::string> > sync_options_key;
+ std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_key;
+ std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_options_key;
std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
std::shared_ptr<const MetadataCollectionKey<Sequence<std::string> > > master_repositories_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unknown_key;
@@ -322,9 +322,9 @@ namespace paludis
"setsdir", "setsdir", mkt_normal, params.setsdir())),
newsdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"newsdir", "newsdir", mkt_normal, params.newsdir())),
- sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
+ sync_key(std::make_shared<LiteralMetadataStringStringMapKey>(
"sync", "sync", mkt_normal, params.sync())),
- sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
+ sync_options_key(std::make_shared<LiteralMetadataStringStringMapKey>(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"builddir", "builddir", mkt_normal, params.builddir())),
@@ -365,7 +365,7 @@ namespace paludis
make_binary_keywords_filter(params.binary_keywords_filter()))),
accounts_repository_data_location_key(layout->accounts_repository_data_location_key()),
e_updates_location_key(layout->e_updates_location_key()),
- sync_hosts(std::make_shared<Map<std::string, std::string> >()),
+ sync_hosts(params.sync()),
sync_host_key(std::make_shared<LiteralMetadataStringStringMapKey>("sync_host", "sync_host", mkt_internal, sync_hosts)),
eclass_mtimes(std::make_shared<EclassMtimes>(r, params.eclassdirs())),
master_mtime(0)
@@ -396,8 +396,6 @@ namespace paludis
FSStat mtfs(mtf.stat());
if (mtfs.exists())
master_mtime = mtfs.mtim().seconds();
-
- sync_hosts->insert("", extract_host_from_url(params.sync()));
}
Imp<ERepository>::~Imp()
@@ -761,11 +759,17 @@ ERepository::sync(
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params.sync().empty() || ! suffix.empty())
+ std::string sync_uri, sync_options;
+ if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix))
+ sync_uri = _imp->params.sync()->find(suffix)->second;
+ if (sync_uri.empty())
return false;
+ if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(suffix))
+ sync_options = _imp->params.sync_options()->find(suffix)->second;
+
std::list<std::string> sync_list;
- tokenise_whitespace(_imp->params.sync(), std::back_inserter(sync_list));
+ tokenise_whitespace(sync_uri, std::back_inserter(sync_list));
bool ok(false);
for (std::list<std::string>::const_iterator s(sync_list.begin()),
@@ -778,7 +782,7 @@ ERepository::sync(
));
SyncOptions opts(make_named_values<SyncOptions>(
n::filter_file() = _imp->layout->sync_filter_file(),
- n::options() = _imp->params.sync_options(),
+ n::options() = sync_options,
n::output_manager() = output_manager
));
try
@@ -795,7 +799,7 @@ ERepository::sync(
}
if (! ok)
- throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
+ throw SyncFailedError(stringify(_imp->params.location()), sync_uri);
return true;
}
@@ -1447,9 +1451,11 @@ ERepository::repository_factory_create(
}
}
- std::string sync(f("sync"));
+ auto sync(std::make_shared<Map<std::string, std::string> >());
+ sync->insert("", f("sync"));
- std::string sync_options(f("sync_options"));
+ auto sync_options(std::make_shared<Map<std::string, std::string> >());
+ sync_options->insert("", f("sync_options"));
std::string builddir(f("builddir"));
if (builddir.empty())
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index 30112a3..66c7b73 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -22,6 +22,7 @@
#include <paludis/util/fs_path.hh>
#include <paludis/util/named_value.hh>
+#include <paludis/util/map-fwd.hh>
#include <memory>
/** \file
@@ -105,8 +106,8 @@ namespace paludis
NamedValue<n::profiles_explicitly_set, bool> profiles_explicitly_set;
NamedValue<n::securitydir, FSPath> securitydir;
NamedValue<n::setsdir, FSPath> setsdir;
- NamedValue<n::sync, std::string> sync;
- NamedValue<n::sync_options, std::string> sync_options;
+ NamedValue<n::sync, std::shared_ptr<Map<std::string, std::string> > > sync;
+ NamedValue<n::sync_options, std::shared_ptr<Map<std::string, std::string> > > sync_options;
NamedValue<n::use_manifest, erepository::UseManifest> use_manifest;
NamedValue<n::write_bin_uri_prefix, std::string> write_bin_uri_prefix;
NamedValue<n::write_cache, FSPath> write_cache;
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 3a7bda1..bf80521 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -54,8 +54,8 @@ namespace paludis
const std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
const std::shared_ptr<LiteralMetadataValueKey<FSPath> > location_key;
- const std::shared_ptr<LiteralMetadataValueKey<std::string> > sync_key;
- const std::shared_ptr<LiteralMetadataValueKey<std::string> > sync_options_key;
+ const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_key;
+ const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_options_key;
const std::shared_ptr<Map<std::string, std::string> > sync_hosts;
const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_host_key;
@@ -68,16 +68,15 @@ namespace paludis
mkt_significant, "unavailable")),
location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
+ sync_key(std::make_shared<LiteralMetadataStringStringMapKey>(
"sync", "sync", mkt_normal, params.sync())),
- sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
+ sync_options_key(std::make_shared<LiteralMetadataStringStringMapKey>(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- sync_hosts(std::make_shared<Map<std::string, std::string> >()),
+ sync_hosts(params.sync()),
sync_host_key(std::make_shared<LiteralMetadataStringStringMapKey>("sync_host", "sync_host", mkt_internal, sync_hosts)),
store(DeferredConstructionPtr<std::shared_ptr<UnavailableRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
- sync_hosts->insert("", extract_host_from_url(params.sync()));
}
};
}
@@ -270,11 +269,17 @@ UnavailableRepository::sync(
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params.sync().empty() || ! suffix.empty())
+ std::string sync_uri, sync_options;
+ if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix))
+ sync_uri = _imp->params.sync()->find(suffix)->second;
+ if (sync_uri.empty())
return false;
+ if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(suffix))
+ sync_options = _imp->params.sync_options()->find(suffix)->second;
+
std::list<std::string> sync_list;
- tokenise_whitespace(_imp->params.sync(), std::back_inserter(sync_list));
+ tokenise_whitespace(sync_uri, std::back_inserter(sync_list));
bool ok(false);
for (std::list<std::string>::const_iterator s(sync_list.begin()),
@@ -287,7 +292,7 @@ UnavailableRepository::sync(
));
SyncOptions opts(make_named_values<SyncOptions>(
n::filter_file() = FSPath("/dev/null"),
- n::options() = _imp->params.sync_options(),
+ n::options() = sync_options,
n::output_manager() = output_manager
));
try
@@ -304,7 +309,7 @@ UnavailableRepository::sync(
}
if (! ok)
- throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
+ throw SyncFailedError(stringify(_imp->params.location()), sync_uri);
return true;
}
@@ -324,9 +329,11 @@ UnavailableRepository::repository_factory_create(
if (location.empty())
throw UnavailableRepositoryConfigurationError("Key 'location' not specified or empty");
- std::string sync(f("sync"));
+ auto sync(std::make_shared<Map<std::string, std::string> >());
+ sync->insert("", f("sync"));
- std::string sync_options(f("sync_options"));
+ auto sync_options(std::make_shared<Map<std::string, std::string> >());
+ sync_options->insert("", f("sync_options"));
return std::make_shared<UnavailableRepository>(
make_named_values<UnavailableRepositoryParams>(
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index 816154a..a0c18dd 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -50,8 +50,8 @@ namespace paludis
NamedValue<n::environment, Environment *> environment;
NamedValue<n::location, FSPath> location;
NamedValue<n::name, RepositoryName> name;
- NamedValue<n::sync, std::string> sync;
- NamedValue<n::sync_options, std::string> sync_options;
+ NamedValue<n::sync, std::shared_ptr<Map<std::string, std::string> > > sync;
+ NamedValue<n::sync_options, std::shared_ptr<Map<std::string, std::string> > > sync_options;
};
class PALUDIS_VISIBLE UnavailableRepository :
diff --git a/paludis/repositories/unavailable/unavailable_repository_TEST.cc b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
index 9262fca..7be785a 100644
--- a/paludis/repositories/unavailable/unavailable_repository_TEST.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/map.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filtered_generator.hh>
@@ -53,8 +54,8 @@ namespace test_cases
n::environment() = &env,
n::location() = FSPath::cwd() / "unavailable_repository_TEST_dir" / "repo1",
n::name() = RepositoryName("unavailable"),
- n::sync() = "",
- n::sync_options() = ""
+ n::sync() = std::make_shared<Map<std::string, std::string> >(),
+ n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
env.package_database()->add_repository(1, repo);
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "unavailable");
@@ -73,8 +74,8 @@ namespace test_cases
n::environment() = &env,
n::location() = FSPath::cwd() / "unavailable_repository_TEST_dir" / "repo2",
n::name() = RepositoryName("unavailable"),
- n::sync() = "",
- n::sync_options() = ""
+ n::sync() = std::make_shared<Map<std::string, std::string> >(),
+ n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
env.package_database()->add_repository(1, repo);
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "unavailable");
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index a9247aa..666b163 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -54,8 +54,8 @@ namespace paludis
const std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
const std::shared_ptr<LiteralMetadataValueKey<FSPath> > location_key;
- const std::shared_ptr<LiteralMetadataValueKey<std::string> > sync_key;
- const std::shared_ptr<LiteralMetadataValueKey<std::string> > sync_options_key;
+ const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_key;
+ const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_options_key;
const std::shared_ptr<Map<std::string, std::string> > sync_hosts;
const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_host_key;
@@ -68,16 +68,18 @@ namespace paludis
mkt_significant, "unwritten")),
location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
+ sync_key(std::make_shared<LiteralMetadataStringStringMapKey>(
"sync", "sync", mkt_normal, params.sync())),
- sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
+ sync_options_key(std::make_shared<LiteralMetadataStringStringMapKey>(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
sync_hosts(std::make_shared<Map<std::string, std::string> >()),
sync_host_key(std::make_shared<LiteralMetadataStringStringMapKey>("sync_host", "sync_host", mkt_internal, sync_hosts)),
store(DeferredConstructionPtr<std::shared_ptr<UnwrittenRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
- sync_hosts->insert("", extract_host_from_url(params.sync()));
+ for (auto i(params.sync()->begin()), i_end(params.sync()->end()) ;
+ i != i_end ; ++i)
+ sync_hosts->insert(i->first, extract_host_from_url(i->second));
}
};
}
@@ -270,11 +272,17 @@ UnwrittenRepository::sync(
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params.sync().empty() || ! suffix.empty())
+ std::string sync_uri, sync_options;
+ if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix))
+ sync_uri = _imp->params.sync()->find(suffix)->second;
+ if (sync_uri.empty())
return false;
+ if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(suffix))
+ sync_options = _imp->params.sync_options()->find(suffix)->second;
+
std::list<std::string> sync_list;
- tokenise_whitespace(_imp->params.sync(), std::back_inserter(sync_list));
+ tokenise_whitespace(sync_uri, std::back_inserter(sync_list));
bool ok(false);
for (std::list<std::string>::const_iterator s(sync_list.begin()),
@@ -287,7 +295,7 @@ UnwrittenRepository::sync(
));
SyncOptions opts(make_named_values<SyncOptions>(
n::filter_file() = FSPath("/dev/null"),
- n::options() = _imp->params.sync_options(),
+ n::options() = sync_options,
n::output_manager() = output_manager
));
try
@@ -304,7 +312,7 @@ UnwrittenRepository::sync(
}
if (! ok)
- throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
+ throw SyncFailedError(stringify(_imp->params.location()), sync_uri);
return true;
}
@@ -324,9 +332,11 @@ UnwrittenRepository::repository_factory_create(
if (location.empty())
throw UnwrittenRepositoryConfigurationError("Key 'location' not specified or empty");
- std::string sync(f("sync"));
+ auto sync(std::make_shared<Map<std::string, std::string> >());
+ sync->insert("", f("sync"));
- std::string sync_options(f("sync_options"));
+ auto sync_options(std::make_shared<Map<std::string, std::string> >());
+ sync_options->insert("", f("sync_options"));
return std::make_shared<UnwrittenRepository>(
make_named_values<UnwrittenRepositoryParams>(
diff --git a/paludis/repositories/unwritten/unwritten_repository.hh b/paludis/repositories/unwritten/unwritten_repository.hh
index e6dd8d6..5adf816 100644
--- a/paludis/repositories/unwritten/unwritten_repository.hh
+++ b/paludis/repositories/unwritten/unwritten_repository.hh
@@ -49,8 +49,8 @@ namespace paludis
NamedValue<n::environment, Environment *> environment;
NamedValue<n::location, FSPath> location;
NamedValue<n::name, RepositoryName> name;
- NamedValue<n::sync, std::string> sync;
- NamedValue<n::sync_options, std::string> sync_options;
+ NamedValue<n::sync, std::shared_ptr<Map<std::string, std::string> > > sync;
+ NamedValue<n::sync_options, std::shared_ptr<Map<std::string, std::string> > > sync_options;
};
class PALUDIS_VISIBLE UnwrittenRepository :
diff --git a/paludis/repositories/unwritten/unwritten_repository_TEST.cc b/paludis/repositories/unwritten/unwritten_repository_TEST.cc
index cb5e1bf..408099a 100644
--- a/paludis/repositories/unwritten/unwritten_repository_TEST.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/map.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filtered_generator.hh>
@@ -52,8 +53,8 @@ namespace test_cases
n::environment() = &env,
n::location() = FSPath::cwd() / "unwritten_repository_TEST_dir" / "repo1",
n::name() = RepositoryName("unwritten"),
- n::sync() = "",
- n::sync_options() = ""
+ n::sync() = std::make_shared<Map<std::string, std::string> >(),
+ n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
env.package_database()->add_repository(1, repo);
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "unwritten");
@@ -72,8 +73,8 @@ namespace test_cases
n::environment() = &env,
n::location() = FSPath::cwd() / "unwritten_repository_TEST_dir" / "repo2",
n::name() = RepositoryName("unwritten"),
- n::sync() = "",
- n::sync_options() = ""
+ n::sync() = std::make_shared<Map<std::string, std::string> >(),
+ n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
env.package_database()->add_repository(1, repo);
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "unwritten");