aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-07 22:21:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-07 22:21:30 +0000
commita7d1a3d9a271be81af6b01ef310147fd2aa35c94 (patch)
tree52a58c2f12643f62e4e4840aee5885b8ad26842b
parente15f518956383d4dc22bee5c13939f8de247a46d (diff)
downloadpaludis-a7d1a3d9a271be81af6b01ef310147fd2aa35c94.tar.gz
paludis-a7d1a3d9a271be81af6b01ef310147fd2aa35c94.tar.xz
Let sync take a suffix
-rw-r--r--paludis/legacy/sync_task.cc2
-rw-r--r--paludis/literal_metadata_key.cc65
-rw-r--r--paludis/literal_metadata_key.hh34
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc6
-rw-r--r--paludis/repositories/accounts/accounts_repository.hh4
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc6
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh4
-rw-r--r--paludis/repositories/cran/cran_repository.cc16
-rw-r--r--paludis/repositories/cran/cran_repository.hh4
-rw-r--r--paludis/repositories/e/e_installed_repository.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository.hh4
-rw-r--r--paludis/repositories/e/e_repository.cc17
-rw-r--r--paludis/repositories/e/e_repository.hh4
-rw-r--r--paludis/repositories/e/exndbam_repository.cc2
-rw-r--r--paludis/repositories/e/exndbam_repository.hh2
-rw-r--r--paludis/repositories/e/vdb_repository.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.hh2
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_installed_repository.hh2
-rw-r--r--paludis/repositories/fake/fake_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_repository.hh2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc4
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh2
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.cc4
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.hh4
-rw-r--r--paludis/repositories/repository/repository_repository.cc6
-rw-r--r--paludis/repositories/repository/repository_repository.hh4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc15
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh4
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc6
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh4
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc6
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc15
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh4
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc6
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh4
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc6
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh4
-rw-r--r--paludis/repository.hh13
-rw-r--r--src/clients/cave/cmd_sync.cc6
41 files changed, 224 insertions, 81 deletions
diff --git a/paludis/legacy/sync_task.cc b/paludis/legacy/sync_task.cc
index 4900541..8587c25 100644
--- a/paludis/legacy/sync_task.cc
+++ b/paludis/legacy/sync_task.cc
@@ -121,7 +121,7 @@ namespace
std::shared_ptr<const Repository> rr(env->package_database()->fetch_repository(r));
CreateOutputManagerForRepositorySyncInfo info(rr->name(), oe_exclusive, ClientOutputFeatures());
std::shared_ptr<OutputManager> output_manager(env->create_output_manager(info));
- if (rr->sync(output_manager))
+ if (rr->sync("", output_manager))
{
Lock l(mutex);
task->on_sync_succeed(r);
diff --git a/paludis/literal_metadata_key.cc b/paludis/literal_metadata_key.cc
index 9fbc234..6ccc625 100644
--- a/paludis/literal_metadata_key.cc
+++ b/paludis/literal_metadata_key.cc
@@ -71,6 +71,24 @@ namespace paludis
};
template <>
+ struct Imp<LiteralMetadataStringStringMapKey>
+ {
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+ const std::shared_ptr<const Map<std::string, std::string> > value;
+
+ Imp(const std::string & r, const std::string & h, const MetadataKeyType t,
+ const std::shared_ptr<const Map<std::string, std::string> > & v) :
+ raw_name(r),
+ human_name(h),
+ type(t),
+ value(v)
+ {
+ }
+ };
+
+ template <>
struct Imp<LiteralMetadataStringSequenceKey>
{
const std::string raw_name;
@@ -173,6 +191,23 @@ LiteralMetadataStringSetKey::value() const
return _imp->value;
}
+LiteralMetadataStringStringMapKey::LiteralMetadataStringStringMapKey(const std::string & r, const std::string & h,
+ const MetadataKeyType t, const std::shared_ptr<const Map<std::string, std::string> > & v) :
+ Pimp<LiteralMetadataStringStringMapKey>(r, h, t, v),
+ _imp(Pimp<LiteralMetadataStringStringMapKey>::_imp)
+{
+}
+
+LiteralMetadataStringStringMapKey::~LiteralMetadataStringStringMapKey()
+{
+}
+
+const std::shared_ptr<const Map<std::string, std::string> >
+LiteralMetadataStringStringMapKey::value() const
+{
+ return _imp->value;
+}
+
LiteralMetadataStringSequenceKey::LiteralMetadataStringSequenceKey(const std::string & r, const std::string & h,
const MetadataKeyType t, const std::shared_ptr<const Sequence<std::string> > & v) :
Pimp<LiteralMetadataStringSequenceKey>(r, h, t, v),
@@ -214,6 +249,11 @@ namespace
{
return f.format(i, format::Plain());
}
+
+ std::string format_string_string(const std::pair<const std::string, std::string> & i, const Formatter<std::pair<const std::string, std::string> > & f)
+ {
+ return f.format(i, format::Plain());
+ }
}
std::string
@@ -224,6 +264,13 @@ LiteralMetadataStringSetKey::pretty_print_flat(const Formatter<std::string> & f)
}
std::string
+LiteralMetadataStringStringMapKey::pretty_print_flat(const Formatter<std::pair<const std::string, std::string> > & f) const
+{
+ using namespace std::placeholders;
+ return join(value()->begin(), value()->end(), " ", std::bind(&format_string_string, _1, f));
+}
+
+std::string
LiteralMetadataStringSequenceKey::pretty_print_flat(const Formatter<std::string> & f) const
{
using namespace std::placeholders;
@@ -248,6 +295,24 @@ LiteralMetadataStringSetKey::type() const
return _imp->type;
}
+const std::string
+LiteralMetadataStringStringMapKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+const std::string
+LiteralMetadataStringStringMapKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+MetadataKeyType
+LiteralMetadataStringStringMapKey::type() const
+{
+ return _imp->type;
+}
+
template <typename T_>
const std::string
LiteralMetadataValueKey<T_>::human_name() const
diff --git a/paludis/literal_metadata_key.hh b/paludis/literal_metadata_key.hh
index 112fa30..b514e1f 100644
--- a/paludis/literal_metadata_key.hh
+++ b/paludis/literal_metadata_key.hh
@@ -270,6 +270,40 @@ namespace paludis
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
+
+ /**
+ * A LiteralMetadataStringStringMapKey is a MetadataCollectionKey<Set<std::string> >
+ * whose value is known at construction time.
+ *
+ * \ingroup g_literal_metadata_key
+ * \since 0.55
+ */
+ class PALUDIS_VISIBLE LiteralMetadataStringStringMapKey :
+ public MetadataCollectionKey<Map<std::string, std::string> >,
+ private Pimp<LiteralMetadataStringStringMapKey>
+ {
+ private:
+ Pimp<LiteralMetadataStringStringMapKey>::ImpPtr & _imp;
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ LiteralMetadataStringStringMapKey(const std::string &, const std::string &, const MetadataKeyType,
+ const std::shared_ptr<const Map<std::string, std::string> > &);
+ ~LiteralMetadataStringStringMapKey();
+
+ ///\}
+
+ virtual const std::shared_ptr<const Map<std::string, std::string> > value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat(const Formatter<std::pair<const std::string, std::string> > &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
}
#endif
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index b056a5b..e831075 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -265,7 +265,7 @@ AccountsRepository::installed_root_key() const
return _imp->installed_root_key;
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
AccountsRepository::sync_host_key() const
{
return make_null_shared_ptr();
@@ -449,7 +449,9 @@ AccountsRepository::perform_hook(
}
bool
-AccountsRepository::sync(const std::shared_ptr<OutputManager> &) const
+AccountsRepository::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
diff --git a/paludis/repositories/accounts/accounts_repository.hh b/paludis/repositories/accounts/accounts_repository.hh
index 0ce4e5b..8ec805d 100644
--- a/paludis/repositories/accounts/accounts_repository.hh
+++ b/paludis/repositories/accounts/accounts_repository.hh
@@ -113,7 +113,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\}
@@ -145,7 +145,7 @@ namespace paludis
virtual HookResult perform_hook(
const Hook & hook,
const std::shared_ptr<OutputManager> &);
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
///\}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index fdaac6d..7c34e75 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -570,7 +570,7 @@ CRANInstalledRepository::installed_root_key() const
return _imp->installed_root_key;
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
CRANInstalledRepository::sync_host_key() const
{
return make_null_shared_ptr();
@@ -591,7 +591,9 @@ CRANInstalledRepository::perform_hook(
}
bool
-CRANInstalledRepository::sync(const std::shared_ptr<OutputManager> &) const
+CRANInstalledRepository::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index e2f2544..a951e68 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -147,7 +147,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
/* Keys */
@@ -155,7 +155,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name Set methods
///\{
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 6df82a4..1bf2028 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -82,7 +82,8 @@ namespace paludis
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 MetadataValueKey<std::string> > sync_host_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,8 +97,10 @@ Imp<CRANRepository>::Imp(const CRANRepositoryParams & p, const std::shared_ptr<M
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_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(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()));
}
Imp<CRANRepository>::~Imp()
@@ -341,8 +344,13 @@ CRANRepository::do_install(const std::shared_ptr<const PackageID> & id_uncasted,
#endif
bool
-CRANRepository::sync(const std::shared_ptr<OutputManager> & output_manager) const
+CRANRepository::sync(
+ const std::string & suffix,
+ const std::shared_ptr<OutputManager> & output_manager) const
{
+ if (! suffix.empty())
+ return false;
+
Context context("When syncing repository '" + stringify(name()) + "':");
Lock l(*_imp->big_nasty_mutex);
@@ -554,7 +562,7 @@ CRANRepository::installed_root_key() const
return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
CRANRepository::sync_host_key() const
{
return _imp->sync_host_key;
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 1e0d946..5695f2b 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -125,7 +125,7 @@ namespace paludis
/* RepositorySyncableInterface */
- virtual bool sync(const std::shared_ptr<OutputManager> & output_deviant) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> & output_deviant) const;
/* Repository */
@@ -158,7 +158,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name Set methods
///\{
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index fe1ea82..c702b90 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -399,7 +399,7 @@ EInstalledRepository::populate_sets() const
}
bool
-EInstalledRepository::sync(const std::shared_ptr<OutputManager> &) const
+EInstalledRepository::sync(const std::string &, const std::shared_ptr<OutputManager> &) const
{
return false;
}
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index e028bda..4d2716c 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -88,7 +88,9 @@ namespace paludis
const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const;
///\name For use by EInstalledRepositoryID
///\{
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index be5bd0e..612cc0f 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -271,7 +271,8 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<FSPath> > accounts_repository_data_location_key;
std::shared_ptr<const MetadataValueKey<FSPath> > e_updates_location_key;
std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key;
- std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key;
+ std::shared_ptr<Map<std::string, std::string> > sync_hosts;
+ std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key;
std::list<std::shared_ptr<const MetadataKey> > about_keys;
std::shared_ptr<EclassMtimes> eclass_mtimes;
@@ -364,9 +365,9 @@ 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_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(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)),
eclass_mtimes(std::make_shared<EclassMtimes>(r, params.eclassdirs())),
-
master_mtime(0)
{
if ((params.location() / "metadata" / "about.conf").stat().is_regular_file_or_symlink_to_regular_file())
@@ -395,6 +396,8 @@ 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()
@@ -752,11 +755,13 @@ ERepository::need_mirrors() const
}
bool
-ERepository::sync(const std::shared_ptr<OutputManager> & output_manager) const
+ERepository::sync(
+ const std::string & suffix,
+ const std::shared_ptr<OutputManager> & output_manager) const
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params.sync().empty())
+ if (_imp->params.sync().empty() || ! suffix.empty())
return false;
std::list<std::string> sync_list;
@@ -1673,7 +1678,7 @@ ERepository::accept_keywords_key() const
return _imp->accept_keywords_key;
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
ERepository::sync_host_key() const
{
return _imp->sync_host_key;
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 2891bb8..666f079 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -108,7 +108,7 @@ namespace paludis
/* RepositorySyncableInterface */
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
/* RepositoryEnvironmentVariableInterface */
@@ -173,7 +173,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > info_vars_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 68fbccd..12b805b 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -285,7 +285,7 @@ ExndbamRepository::installed_root_key() const
return _imp->root_key;
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
ExndbamRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index 8937379..0c6fbb7 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.hh
@@ -116,7 +116,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name For use by ExndbamID
///\{
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index e3eb95d..efdb3dc 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1179,7 +1179,7 @@ VDBRepository::installed_root_key() const
return _imp->root_key;
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
VDBRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index e79c53a..8e8dfc2 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -163,7 +163,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 50b09a3..33249aa 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -257,7 +257,7 @@ FakeInstalledRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
FakeInstalledRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/fake/fake_installed_repository.hh b/paludis/repositories/fake/fake_installed_repository.hh
index 816dbd7..2f64d79 100644
--- a/paludis/repositories/fake/fake_installed_repository.hh
+++ b/paludis/repositories/fake/fake_installed_repository.hh
@@ -97,7 +97,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index f5e2a51..e215b47 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -176,7 +176,7 @@ FakeRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
FakeRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index 89751ad..19c224e 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -91,7 +91,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
};
}
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 378dc5e..b3d4f04 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -209,7 +209,9 @@ FakeRepositoryBase::perform_hook(const Hook &, const std::shared_ptr<OutputManag
}
bool
-FakeRepositoryBase::sync(const std::shared_ptr<OutputManager> &) const
+FakeRepositoryBase::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index ed6c0c3..759f295 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -117,7 +117,7 @@ namespace paludis
virtual bool has_category_named(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
///\name Set methods
///\{
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.cc b/paludis/repositories/gemcutter/gemcutter_repository.cc
index 934ff56..87e6390 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.cc
+++ b/paludis/repositories/gemcutter/gemcutter_repository.cc
@@ -253,7 +253,7 @@ GemcutterRepository::some_ids_might_not_be_masked() const
}
bool
-GemcutterRepository::sync(const std::shared_ptr<OutputManager> &) const
+GemcutterRepository::sync(const std::string &, const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -317,7 +317,7 @@ GemcutterRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
GemcutterRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.hh b/paludis/repositories/gemcutter/gemcutter_repository.hh
index ffecd7e..78b0557 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.hh
+++ b/paludis/repositories/gemcutter/gemcutter_repository.hh
@@ -76,7 +76,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
virtual bool has_category_named(const CategoryNamePart & c) const;
virtual bool has_package_named(const QualifiedPackageName & q) const;
@@ -91,7 +91,7 @@ namespace paludis
virtual void invalidate();
virtual void invalidate_masks();
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index a7d6b18..fad366a 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -264,7 +264,7 @@ RepositoryRepository::some_ids_might_not_be_masked() const
}
bool
-RepositoryRepository::sync(const std::shared_ptr<OutputManager> &) const
+RepositoryRepository::sync(const std::string &, const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -338,7 +338,7 @@ RepositoryRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
RepositoryRepository::sync_host_key() const
{
return make_null_shared_ptr();
@@ -478,7 +478,7 @@ RepositoryRepository::merge(const MergeParams & m)
}
m.output_manager()->stdout_stream() << "Syncing..." << std::endl;
- _imp->params.environment()->repository_from_new_config_file(config_filename_file)->sync(m.output_manager());
+ _imp->params.environment()->repository_from_new_config_file(config_filename_file)->sync("", m.output_manager());
/* the repo we'd get before syncing is mostly unusable */
const std::shared_ptr<Repository> newly_created_repo(
diff --git a/paludis/repositories/repository/repository_repository.hh b/paludis/repositories/repository/repository_repository.hh
index e0045c5..be8dbb5 100644
--- a/paludis/repositories/repository/repository_repository.hh
+++ b/paludis/repositories/repository/repository_repository.hh
@@ -80,7 +80,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
virtual bool has_category_named(const CategoryNamePart & c) const;
virtual bool has_package_named(const QualifiedPackageName & q) const;
@@ -97,7 +97,7 @@ namespace paludis
virtual void invalidate();
virtual void invalidate_masks();
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
virtual bool is_suitable_destination_for(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 1b41c17..3a7bda1 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -56,7 +56,8 @@ namespace paludis
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<LiteralMetadataValueKey<std::string> > sync_host_key;
+ const std::shared_ptr<Map<std::string, std::string> > sync_hosts;
+ const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_host_key;
const ActiveObjectPtr<DeferredConstructionPtr<
std::shared_ptr<UnavailableRepositoryStore> > > store;
@@ -71,10 +72,12 @@ namespace paludis
"sync", "sync", mkt_normal, params.sync())),
sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(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)),
store(DeferredConstructionPtr<std::shared_ptr<UnavailableRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
+ sync_hosts->insert("", extract_host_from_url(params.sync()));
}
};
}
@@ -261,11 +264,13 @@ UnavailableRepository::some_ids_might_not_be_masked() const
}
bool
-UnavailableRepository::sync(const std::shared_ptr<OutputManager> & output_manager) const
+UnavailableRepository::sync(
+ const std::string & suffix,
+ const std::shared_ptr<OutputManager> & output_manager) const
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params.sync().empty())
+ if (_imp->params.sync().empty() || ! suffix.empty())
return false;
std::list<std::string> sync_list;
@@ -369,7 +374,7 @@ UnavailableRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
UnavailableRepository::sync_host_key() const
{
return _imp->sync_host_key;
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index ad8ce33..816154a 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -79,7 +79,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
virtual bool has_category_named(const CategoryNamePart & c) const;
virtual bool has_package_named(const QualifiedPackageName & q) const;
@@ -96,7 +96,7 @@ namespace paludis
virtual void invalidate();
virtual void invalidate_masks();
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 0343fe3..771613f 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -505,7 +505,9 @@ InstalledUnpackagedRepository::perform_hook(const Hook &, const std::shared_ptr<
}
bool
-InstalledUnpackagedRepository::sync(const std::shared_ptr<OutputManager> &) const
+InstalledUnpackagedRepository::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -516,7 +518,7 @@ InstalledUnpackagedRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
InstalledUnpackagedRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index 478e954..e12a2ab 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -112,7 +112,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name RepositoryFactory functions
///\{
@@ -141,7 +141,7 @@ namespace paludis
virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
};
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 080ad08..51e4c7f 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -307,7 +307,9 @@ UnpackagedRepository::perform_hook(const Hook &, const std::shared_ptr<OutputMan
}
bool
-UnpackagedRepository::sync(const std::shared_ptr<OutputManager> &) const
+UnpackagedRepository::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -318,7 +320,7 @@ UnpackagedRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
UnpackagedRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index f8a28a5..14bd983 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -109,7 +109,7 @@ namespace paludis
virtual const bool is_unimportant() const;
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
/* Keys */
@@ -117,7 +117,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 341fa5b..a9247aa 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -56,7 +56,8 @@ namespace paludis
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<LiteralMetadataValueKey<std::string> > sync_host_key;
+ const std::shared_ptr<Map<std::string, std::string> > sync_hosts;
+ const std::shared_ptr<LiteralMetadataStringStringMapKey> sync_host_key;
const ActiveObjectPtr<DeferredConstructionPtr<
std::shared_ptr<UnwrittenRepositoryStore> > > store;
@@ -71,10 +72,12 @@ namespace paludis
"sync", "sync", mkt_normal, params.sync())),
sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(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)),
store(DeferredConstructionPtr<std::shared_ptr<UnwrittenRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
+ sync_hosts->insert("", extract_host_from_url(params.sync()));
}
};
}
@@ -261,11 +264,13 @@ UnwrittenRepository::some_ids_might_not_be_masked() const
}
bool
-UnwrittenRepository::sync(const std::shared_ptr<OutputManager> & output_manager) const
+UnwrittenRepository::sync(
+ const std::string & suffix,
+ const std::shared_ptr<OutputManager> & output_manager) const
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params.sync().empty())
+ if (_imp->params.sync().empty() || ! suffix.empty())
return false;
std::list<std::string> sync_list;
@@ -372,7 +377,7 @@ UnwrittenRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
UnwrittenRepository::sync_host_key() const
{
return _imp->sync_host_key;
diff --git a/paludis/repositories/unwritten/unwritten_repository.hh b/paludis/repositories/unwritten/unwritten_repository.hh
index df85bbc..e6dd8d6 100644
--- a/paludis/repositories/unwritten/unwritten_repository.hh
+++ b/paludis/repositories/unwritten/unwritten_repository.hh
@@ -78,7 +78,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
virtual bool has_category_named(const CategoryNamePart & c) const;
virtual bool has_package_named(const QualifiedPackageName & q) const;
@@ -95,7 +95,7 @@ namespace paludis
virtual void invalidate();
virtual void invalidate_masks();
- virtual bool sync(const std::shared_ptr<OutputManager> & output_manager) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> & output_manager) const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 97e7bec..5b02b35 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -394,7 +394,9 @@ InstalledVirtualsRepository::populate_sets() const
}
bool
-InstalledVirtualsRepository::sync(const std::shared_ptr<OutputManager> &) const
+InstalledVirtualsRepository::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -405,7 +407,7 @@ InstalledVirtualsRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
InstalledVirtualsRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 83f1294..b2e397a 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -110,7 +110,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
/* Keys */
@@ -118,7 +118,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
/* RepositoryDestinationInterface */
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index b9fddc7..f499eb8 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -472,7 +472,9 @@ VirtualsRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManag
}
bool
-VirtualsRepository::sync(const std::shared_ptr<OutputManager> &) const
+VirtualsRepository::sync(
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -483,7 +485,7 @@ VirtualsRepository::accept_keywords_key() const
return make_null_shared_ptr();
}
-const std::shared_ptr<const MetadataValueKey<std::string> >
+const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
VirtualsRepository::sync_host_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index bea701b..649eda3 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -107,7 +107,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
- virtual bool sync(const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
/* RepositoryMakeVirtualsInterface */
@@ -121,7 +121,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
///\name Set methods
///\{
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 8261f8e..e1018e4 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -34,6 +34,7 @@
#include <paludis/util/named_value.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/singleton.hh>
+#include <paludis/util/map-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key-fwd.hh>
@@ -317,15 +318,16 @@ namespace paludis
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const = 0;
/**
- * The sync_host_key, if present, should have a value containing
- * the host against which a sync will be performed.
+ * The sync_host_key, if present, should have value containing
+ * the host against which a sync will be performed for each suffix.
*
* This is used to avoid starting multiple parallel syncs against
* the same host.
*
* \since 0.44
+ * \since 0.55 is a Map<std::string, std::string>.
*/
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const = 0;
+ virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const = 0;
///\}
@@ -437,8 +439,11 @@ namespace paludis
*
* \return True if we synced successfully, false if we skipped sync.
* \since 0.42 (previously in an interface)
+ * \since 0.55 takes a suffix
*/
- virtual bool sync(const std::shared_ptr<OutputManager> &) const = 0;
+ virtual bool sync(
+ const std::string & suffix,
+ const std::shared_ptr<OutputManager> &) const = 0;
/**
* Allow the Repository to drop any memory-cached metadata and
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index c12a848..6058aa5 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -131,8 +131,8 @@ namespace
return "";
const std::shared_ptr<const Repository> r(env->package_database()->fetch_repository(name));
- if (r->sync_host_key())
- return r->sync_host_key()->value();
+ if (r->sync_host_key() && r->sync_host_key()->value()->end() != r->sync_host_key()->value()->find(""))
+ return r->sync_host_key()->value()->find("")->second;
else
return "";
}
@@ -193,7 +193,7 @@ namespace
{
const std::shared_ptr<Repository> repo(env->package_database()->fetch_repository(name));
- if (! repo->sync(output_manager))
+ if (! repo->sync("", output_manager))
skipped = true;
success = true;
}