aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/e/Makefile.am2
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc5
-rw-r--r--paludis/repositories/e/e_repository.cc102
-rw-r--r--paludis/repositories/e/exndbam_repository.cc5
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc57
-rw-r--r--paludis/repositories/e/extra_distribution_data.hh61
-rw-r--r--paludis/repositories/e/vdb_repository.cc13
-rw-r--r--paludis/repositories/gems/Makefile.am4
-rw-r--r--paludis/repositories/gems/extra_distribution_data.cc50
-rw-r--r--paludis/repositories/gems/extra_distribution_data.hh45
-rw-r--r--paludis/repositories/gems/gems_repository.cc4
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc4
12 files changed, 293 insertions, 59 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index fb4a944..654ef0e 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -68,6 +68,7 @@ paludis_repositories_e_include_HEADERS = \
exndbam_id.hh \
exndbam_repository.hh \
exndbam_repository-sr.hh \
+ extra_distribution_data.hh \
fetch_visitor.hh \
info_metadata_key.hh \
pretend_fetch_visitor.hh \
@@ -119,6 +120,7 @@ libpaludiserepository_@PALUDIS_PC_SLOT@_la_SOURCES = \
exndbam_id.cc \
exndbam_repository.cc \
exheres_layout.cc \
+ extra_distribution_data.cc \
fetch_visitor.cc \
info_metadata_key.cc \
pretend_fetch_visitor.cc \
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index dd8d579..1833871 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -19,6 +19,7 @@
#include <paludis/repositories/e/e_installed_repository_id.hh>
#include <paludis/repositories/e/e_key.hh>
+#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/dep_parser.hh>
@@ -547,8 +548,8 @@ EInstalledRepositoryID::eapi() const
Log::get_instance()->message("e.no_eapi", ll_debug, lc_context) << "No EAPI entry in '" << _imp->dir << "', pretending '"
<< _imp->environment->distribution() << "'";
_imp->eapi = EAPIData::get_instance()->eapi_from_string(
- (*DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())).default_ebuild_eapi_when_unspecified());
+ EExtraDistributionData::get_instance()->data_from_distribution(*DistributionData::get_instance()->distribution_from_string(
+ _imp->environment->distribution()))->default_eapi_when_unspecified());
}
return _imp->eapi;
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 3431792..837c76c 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -31,9 +31,11 @@
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/repositories/e/e_repository_entries.hh>
#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/repositories/e/use_desc.hh>
#include <paludis/repositories/e/layout.hh>
#include <paludis/repositories/e/info_metadata_key.hh>
+#include <paludis/repositories/e/extra_distribution_data.hh>
#ifdef ENABLE_QA
# include <paludis/repositories/e/qa/qa_controller.hh>
@@ -104,6 +106,7 @@
*/
using namespace paludis;
+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> > >,
@@ -195,8 +198,8 @@ namespace paludis
mutable std::tr1::shared_ptr<ERepositoryNews> news_ptr;
mutable std::tr1::shared_ptr<ERepositorySets> sets_ptr;
- mutable std::tr1::shared_ptr<erepository::ERepositoryEntries> entries_ptr;
- mutable std::tr1::shared_ptr<erepository::Layout> layout;
+ mutable std::tr1::shared_ptr<ERepositoryEntries> entries_ptr;
+ mutable std::tr1::shared_ptr<Layout> layout;
Implementation(ERepository * const, const ERepositoryParams &, std::tr1::shared_ptr<Mutexes> = make_shared_ptr(new Mutexes));
~Implementation();
@@ -243,8 +246,8 @@ namespace paludis
has_mirrors(false),
has_profiles_desc(false),
sets_ptr(new ERepositorySets(params.environment, r, p)),
- entries_ptr(erepository::ERepositoryEntriesFactory::get_instance()->create(params.entry_format, params.environment, r, p)),
- layout(erepository::LayoutFactory::get_instance()->create(params.layout, r, params.location, entries_ptr, get_master_locations(
+ entries_ptr(ERepositoryEntriesFactory::get_instance()->create(params.entry_format, params.environment, r, p)),
+ layout(LayoutFactory::get_instance()->create(params.layout, r, params.location, entries_ptr, get_master_locations(
params.master_repositories))),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, params.entry_format)),
@@ -298,16 +301,16 @@ namespace paludis
layout->info_packages_files()->end(),
std::tr1::bind(std::tr1::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
std::tr1::placeholders::_1)) ?
- make_shared_ptr(new erepository::InfoPkgsMetadataKey(params.environment, layout->info_packages_files(),
+ make_shared_ptr(new InfoPkgsMetadataKey(params.environment, layout->info_packages_files(),
params.profile_eapi)) :
- std::tr1::shared_ptr<erepository::InfoPkgsMetadataKey>()
+ std::tr1::shared_ptr<InfoPkgsMetadataKey>()
),
info_vars_key(layout->info_variables_files()->end() != std::find_if(layout->info_variables_files()->begin(),
layout->info_variables_files()->end(),
std::tr1::bind(std::tr1::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
std::tr1::placeholders::_1)) ?
- make_shared_ptr(new erepository::InfoVarsMetadataKey(layout->info_variables_files())) :
- std::tr1::shared_ptr<erepository::InfoVarsMetadataKey>()
+ make_shared_ptr(new InfoVarsMetadataKey(layout->info_variables_files())) :
+ std::tr1::shared_ptr<InfoVarsMetadataKey>()
),
binary_destination_key(new LiteralMetadataValueKey<std::string> (
"binary_destination", "binary_destination", mkt_normal, stringify(params.binary_destination))),
@@ -332,7 +335,7 @@ namespace paludis
profile_ptr.reset(new ERepositoryProfile(
params.environment, repo, repo->name(), *params.profiles,
- erepository::EAPIData::get_instance()->eapi_from_string(
+ EAPIData::get_instance()->eapi_from_string(
params.eapi_when_unknown)->supported()->ebuild_environment_variables()->env_arch()));
}
@@ -376,7 +379,7 @@ namespace paludis
value_for<n::path>(*profiles.begin()),
value_for<n::profile>(std::tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
params.environment, repo, repo->name(), profiles,
- erepository::EAPIData::get_instance()->eapi_from_string(
+ EAPIData::get_instance()->eapi_from_string(
params.eapi_when_unknown)->supported()->ebuild_environment_variables()->env_arch()))),
value_for<n::status>(tokens.at(2))
));
@@ -557,11 +560,11 @@ ERepository::repository_masked(const PackageID & id) const
using namespace std::tr1::placeholders;
std::tr1::shared_ptr<const FSEntrySequence> repository_mask_files(_imp->layout->repository_mask_files());
- erepository::ProfileFile<erepository::MaskFile> repository_mask_file;
+ ProfileFile<MaskFile> repository_mask_file;
std::for_each(repository_mask_files->begin(), repository_mask_files->end(),
- std::tr1::bind(&erepository::ProfileFile<erepository::MaskFile>::add_file, std::tr1::ref(repository_mask_file), _1));
+ std::tr1::bind(&ProfileFile<MaskFile>::add_file, std::tr1::ref(repository_mask_file), _1));
- for (erepository::ProfileFile<erepository::MaskFile>::ConstIterator
+ for (ProfileFile<MaskFile>::ConstIterator
line(repository_mask_file.begin()), line_end(repository_mask_file.end()) ;
line != line_end ; ++line)
{
@@ -569,7 +572,7 @@ ERepository::repository_masked(const PackageID & id) const
{
std::tr1::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(parse_elike_package_dep_spec(
line->first,
- erepository::EAPIData::get_instance()->eapi_from_string(
+ EAPIData::get_instance()->eapi_from_string(
_imp->params.profile_eapi)->supported()->package_dep_spec_parse_options(),
std::tr1::shared_ptr<const PackageID>())));
if (a->package_ptr())
@@ -612,7 +615,7 @@ ERepository::query_use(const UseFlagName & f, const PackageID & e) const
if (this != e.repository().get())
return use_unspecified;
- const erepository::ERepositoryID & id(static_cast<const erepository::ERepositoryID &>(e));
+ const ERepositoryID & id(static_cast<const ERepositoryID &>(e));
if (! id.eapi()->supported())
{
@@ -692,7 +695,7 @@ ERepository::query_use_mask(const UseFlagName & u, const PackageID & e) const
if (this != e.repository().get())
return use_unspecified;
- const erepository::ERepositoryID & id(static_cast<const erepository::ERepositoryID &>(e));
+ const ERepositoryID & id(static_cast<const ERepositoryID &>(e));
if (id.use_key())
{
return (id.use_key()->value()->end() == id.use_key()->value()->find(u));
@@ -710,7 +713,7 @@ ERepository::query_use_force(const UseFlagName & u, const PackageID & e) const
if (this != e.repository().get())
return use_unspecified;
- const erepository::ERepositoryID & id(static_cast<const erepository::ERepositoryID &>(e));
+ const ERepositoryID & id(static_cast<const ERepositoryID &>(e));
if (id.use_key())
{
return (id.use_key()->value()->end() != id.use_key()->value()->find(u));
@@ -893,7 +896,7 @@ ERepository::update_news() const
_imp->news_ptr->update_news();
}
-const std::tr1::shared_ptr<const erepository::Layout>
+const std::tr1::shared_ptr<const Layout>
ERepository::layout() const
{
return _imp->layout;
@@ -906,7 +909,7 @@ ERepository::profile() const
return _imp->profile_ptr;
}
-const std::tr1::shared_ptr<const erepository::ERepositoryEntries>
+const std::tr1::shared_ptr<const ERepositoryEntries>
ERepository::entries() const
{
return _imp->entries_ptr;
@@ -922,7 +925,7 @@ ERepository::get_environment_variable(
_imp->need_profiles();
- return _imp->entries_ptr->get_environment_variable(std::tr1::static_pointer_cast<const erepository::ERepositoryID>(for_package),
+ return _imp->entries_ptr->get_environment_variable(std::tr1::static_pointer_cast<const ERepositoryID>(for_package),
var, _imp->profile_ptr);
}
@@ -973,7 +976,7 @@ ERepository::use_expand_flags() const
{
_imp->need_profiles();
- std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(
+ std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(
_imp->params.profile_eapi)->supported()->ebuild_options()->use_expand_separator()));
std::tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandConstIterator i(_imp->profile_ptr->begin_use_expand()),
@@ -1033,7 +1036,7 @@ ERepository::use_expand_separator(const PackageID & id) const
{
if (this != id.repository().get())
return '\0';
- const std::tr1::shared_ptr<const erepository::EAPI> & eapi(static_cast<const erepository::ERepositoryID &>(id).eapi());
+ const std::tr1::shared_ptr<const EAPI> & eapi(static_cast<const ERepositoryID &>(id).eapi());
return eapi->supported() ? eapi->supported()->ebuild_options()->use_expand_separator() : '\0';
}
@@ -1128,7 +1131,7 @@ ERepository::describe_use_flag(const UseFlagName & f,
if (_imp->use_desc.empty())
{
- std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(
+ std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(
_imp->params.profile_eapi)->supported()->ebuild_options()->use_expand_separator()));
std::tr1::shared_ptr<const UseDescFileInfoSequence> use_desc_info(_imp->layout->use_desc_files());
_imp->use_desc.push_back(std::tr1::shared_ptr<UseDesc>(new UseDesc(use_desc_info, expand_sep)));
@@ -1156,7 +1159,7 @@ ERepository::is_suitable_destination_for(const PackageID & e) const
{
std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : "");
if (f == "ebuild")
- return static_cast<const erepository::ERepositoryID &>(e).eapi()->supported()->can_be_pbin();
+ return static_cast<const ERepositoryID &>(e).eapi()->supported()->can_be_pbin();
else
return false;
}
@@ -1398,10 +1401,10 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
std::tr1::shared_ptr<const PackageID> id = (*v);
if (! id->fetches_key())
continue;
- paludis::erepository::AAVisitor aa;
+ AAVisitor aa;
id->fetches_key()->value()->accept(aa);
- for (paludis::erepository::AAVisitor::ConstIterator d(aa.begin()) ;
+ for (AAVisitor::ConstIterator d(aa.begin()) ;
d != aa.end() ; ++d)
{
if (done_files.count(*d))
@@ -1437,14 +1440,14 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
std::string
ERepository::accept_keywords_variable() const
{
- return erepository::EAPIData::get_instance()->eapi_from_string(params().profile_eapi)->supported()
+ return EAPIData::get_instance()->eapi_from_string(params().profile_eapi)->supported()
->ebuild_environment_variables()->env_accept_keywords();
}
std::string
ERepository::arch_variable() const
{
- return erepository::EAPIData::get_instance()->eapi_from_string(params().profile_eapi)->supported()
+ return EAPIData::get_instance()->eapi_from_string(params().profile_eapi)->supported()
->ebuild_environment_variables()->env_arch();
}
@@ -1602,8 +1605,9 @@ ERepository::repository_factory_create(
distdir = stringify((*master_repositories->begin())->params().distdir);
else
{
- distdir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_distdir();
+ distdir = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_distdir();
if (distdir.empty())
distdir = location + "/distfiles";
else if ('/' != distdir.at(0))
@@ -1633,8 +1637,8 @@ ERepository::repository_factory_create(
std::string write_cache(f("write_cache"));
if (write_cache.empty())
- write_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_write_cache();
+ write_cache = EExtraDistributionData::get_instance()->data_from_distribution(*DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_write_cache();
bool append_repository_name_to_write_cache(true);
if (! f("append_repository_name_to_write_cache").empty())
@@ -1655,8 +1659,9 @@ ERepository::repository_factory_create(
{
if (! layout_conf
|| (eapi_when_unknown = layout_conf->get("eapi_when_unknown")).empty())
- eapi_when_unknown = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_eapi_when_unknown();
+ eapi_when_unknown = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_eapi_when_unknown();
}
std::string eapi_when_unspecified(f("eapi_when_unspecified"));
@@ -1664,8 +1669,9 @@ ERepository::repository_factory_create(
{
if (! layout_conf
|| (eapi_when_unspecified = layout_conf->get("eapi_when_unspecified")).empty())
- eapi_when_unspecified = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_eapi_when_unspecified();
+ eapi_when_unspecified = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_eapi_when_unspecified();
}
std::string profile_eapi(f("profile_eapi"));
@@ -1673,15 +1679,17 @@ ERepository::repository_factory_create(
{
if (! layout_conf
|| (profile_eapi = layout_conf->get("eapi_when_unspecified")).empty())
- profile_eapi = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_profile_eapi();
+ profile_eapi = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_profile_eapi();
}
std::string names_cache(f("names_cache"));
if (names_cache.empty())
{
- names_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_names_cache();
+ names_cache = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_names_cache();
if (names_cache.empty())
{
Log::get_instance()->message("e.ebuild.configuration.no_names_cache", ll_warning, lc_no_context)
@@ -1713,8 +1721,9 @@ ERepository::repository_factory_create(
if (master_repositories)
builddir = stringify((*master_repositories->begin())->params().builddir);
else
- builddir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_builddir();
+ builddir = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_buildroot();
}
else
Log::get_instance()->message("e.ebuild.configuration.deprecated", ll_warning, lc_context)
@@ -1726,15 +1735,16 @@ ERepository::repository_factory_create(
{
if (! layout_conf
|| (layout = layout_conf->get("layout")).empty())
- layout = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_layout();
+ layout = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_layout();
}
- erepository::UseManifest use_manifest(erepository::manifest_use);
+ UseManifest use_manifest(manifest_use);
if (! f("use_manifest").empty())
{
Context item_context("When handling use_manifest key:");
- use_manifest = destringify<erepository::UseManifest>(f("use_manifest"));
+ use_manifest = destringify<UseManifest>(f("use_manifest"));
}
bool binary_destination(false);
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 4ef5b22..7789f7e 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/eapi_phase.hh>
+#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/log.hh>
@@ -151,8 +152,8 @@ ExndbamRepository::repository_factory_create(
{
builddir = f("buildroot");
if (builddir.empty())
- builddir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_builddir();
+ builddir = EExtraDistributionData::get_instance()->data_from_distribution(*DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_buildroot();
else
Log::get_instance()->message("e.exndbam.configuration.deprecated", ll_warning, lc_context)
<< "Key 'buildroot' is deprecated, use 'builddir' instead";
diff --git a/paludis/repositories/e/extra_distribution_data.cc b/paludis/repositories/e/extra_distribution_data.cc
new file mode 100644
index 0000000..6e2e086
--- /dev/null
+++ b/paludis/repositories/e/extra_distribution_data.cc
@@ -0,0 +1,57 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/repositories/e/extra_distribution_data.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/distribution-impl.hh>
+
+using namespace paludis;
+using namespace paludis::erepository;
+
+namespace paludis
+{
+ template <>
+ struct ExtraDistributionDataData<EDistribution>
+ {
+ static std::string config_file_name()
+ {
+ return "e.conf";
+ }
+
+ static std::tr1::shared_ptr<EDistribution> make_data(const KeyValueConfigFile & k)
+ {
+ return make_shared_ptr(new EDistribution(make_named_values<EDistribution>(
+ value_for<n::default_buildroot>(k.get("default_buildroot")),
+ value_for<n::default_distdir>(k.get("default_distdir")),
+ value_for<n::default_eapi_when_unknown>(k.get("default_eapi_when_unknown")),
+ value_for<n::default_eapi_when_unspecified>(k.get("default_eapi_when_unspecified")),
+ value_for<n::default_layout>(k.get("default_layout")),
+ value_for<n::default_names_cache>(k.get("default_names_cache")),
+ value_for<n::default_profile_eapi>(k.get("default_profile_eapi")),
+ value_for<n::default_provides_cache>(k.get("default_provides_cache")),
+ value_for<n::default_write_cache>(k.get("default_write_cache"))
+ )));
+ }
+ };
+}
+
+template class ExtraDistributionData<EDistribution>;
+template class InstantiationPolicy<ExtraDistributionData<EDistribution>, instantiation_method::SingletonTag>;
+
diff --git a/paludis/repositories/e/extra_distribution_data.hh b/paludis/repositories/e/extra_distribution_data.hh
new file mode 100644
index 0000000..6071d43
--- /dev/null
+++ b/paludis/repositories/e/extra_distribution_data.hh
@@ -0,0 +1,61 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_E_EXTRA_DISTRIBUTION_DATA_HH
+#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_E_EXTRA_DISTRIBUTION_DATA_HH 1
+
+#include <paludis/distribution-fwd.hh>
+#include <paludis/util/named_value.hh>
+#include <string>
+
+namespace paludis
+{
+ namespace n
+ {
+ struct default_buildroot;
+ struct default_distdir;
+ struct default_eapi_when_unknown;
+ struct default_eapi_when_unspecified;
+ struct default_layout;
+ struct default_names_cache;
+ struct default_profile_eapi;
+ struct default_provides_cache;
+ struct default_write_cache;
+ }
+
+ namespace erepository
+ {
+ struct EDistribution
+ {
+ NamedValue<n::default_buildroot, std::string> default_buildroot;
+ NamedValue<n::default_distdir, std::string> default_distdir;
+ NamedValue<n::default_eapi_when_unknown, std::string> default_eapi_when_unknown;
+ NamedValue<n::default_eapi_when_unspecified, std::string> default_eapi_when_unspecified;
+ NamedValue<n::default_layout, std::string> default_layout;
+ NamedValue<n::default_names_cache, std::string> default_names_cache;
+ NamedValue<n::default_profile_eapi, std::string> default_profile_eapi;
+ NamedValue<n::default_provides_cache, std::string> default_provides_cache;
+ NamedValue<n::default_write_cache, std::string> default_write_cache;
+ };
+
+ typedef ExtraDistributionData<EDistribution> EExtraDistributionData;
+ }
+}
+
+#endif
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 1c1d4b5..be7f276 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -27,6 +27,7 @@
#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/action.hh>
#include <paludis/util/config_file.hh>
@@ -305,8 +306,8 @@ VDBRepository::repository_factory_create(
std::string provides_cache(f("provides_cache"));
if (provides_cache.empty())
{
- provides_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_vdb_provides_cache();
+ provides_cache = EExtraDistributionData::get_instance()->data_from_distribution(*DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_provides_cache();
if (provides_cache.empty())
{
Log::get_instance()->message("e.vdb.configuration.no_provides_cache", ll_warning, lc_no_context)
@@ -319,8 +320,8 @@ VDBRepository::repository_factory_create(
std::string names_cache(f("names_cache"));
if (names_cache.empty())
{
- names_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_vdb_names_cache();
+ names_cache = EExtraDistributionData::get_instance()->data_from_distribution(*DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_names_cache();
if (names_cache.empty())
{
Log::get_instance()->message("e.vdb.configuration.no_names_cache", ll_warning, lc_no_context)
@@ -335,8 +336,8 @@ VDBRepository::repository_factory_create(
{
builddir = f("buildroot");
if (builddir.empty())
- builddir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution())).default_ebuild_builddir();
+ builddir = EExtraDistributionData::get_instance()->data_from_distribution(*DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_buildroot();
else
Log::get_instance()->message("e.vdb.configuration.deprecated", ll_warning, lc_context)
<< "Key 'buildroot' is deprecated, use 'builddir' instead";
diff --git a/paludis/repositories/gems/Makefile.am b/paludis/repositories/gems/Makefile.am
index 0793818..0f8a606 100644
--- a/paludis/repositories/gems/Makefile.am
+++ b/paludis/repositories/gems/Makefile.am
@@ -25,7 +25,8 @@ paludis_repositories_gems_include_HEADERS = \
yaml.hh yaml-fwd.hh \
gem_specification.hh gem_specification-fwd.hh \
gem_specifications.hh \
- params-fwd.hh params.hh params-sr.hh
+ params-fwd.hh params.hh params-sr.hh \
+ extra_distribution_data.hh
libpaludisgemsrepository_@PALUDIS_PC_SLOT@_la_SOURCES = \
gems_repository.cc \
@@ -35,6 +36,7 @@ libpaludisgemsrepository_@PALUDIS_PC_SLOT@_la_SOURCES = \
yaml.cc \
gem_specification.cc \
gem_specifications.cc \
+ extra_distribution_data.cc \
registration.cc \
$(paludis_repositories_gems_include_HEADERS)
diff --git a/paludis/repositories/gems/extra_distribution_data.cc b/paludis/repositories/gems/extra_distribution_data.cc
new file mode 100644
index 0000000..5d8de49
--- /dev/null
+++ b/paludis/repositories/gems/extra_distribution_data.cc
@@ -0,0 +1,50 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/repositories/gems/extra_distribution_data.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/distribution-impl.hh>
+
+using namespace paludis;
+using namespace paludis::gems;
+
+namespace paludis
+{
+ template <>
+ struct ExtraDistributionDataData<GemsDistribution>
+ {
+ static std::string config_file_name()
+ {
+ return "gems.conf";
+ }
+
+ static std::tr1::shared_ptr<GemsDistribution> make_data(const KeyValueConfigFile & k)
+ {
+ return make_shared_ptr(new GemsDistribution(make_named_values<GemsDistribution>(
+ value_for<n::default_buildroot>(k.get("default_buildroot"))
+ )));
+ }
+ };
+}
+
+template class ExtraDistributionData<GemsDistribution>;
+template class InstantiationPolicy<ExtraDistributionData<GemsDistribution>, instantiation_method::SingletonTag>;
+
+
diff --git a/paludis/repositories/gems/extra_distribution_data.hh b/paludis/repositories/gems/extra_distribution_data.hh
new file mode 100644
index 0000000..5f8c211
--- /dev/null
+++ b/paludis/repositories/gems/extra_distribution_data.hh
@@ -0,0 +1,45 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GEMS_EXTRA_DISTRIBUTION_DATA_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GEMS_EXTRA_DISTRIBUTION_DATA_HH 1
+
+#include <paludis/distribution-fwd.hh>
+#include <paludis/util/named_value.hh>
+#include <string>
+
+namespace paludis
+{
+ namespace n
+ {
+ struct default_buildroot;
+ }
+
+ namespace gems
+ {
+ struct GemsDistribution
+ {
+ NamedValue<n::default_buildroot, std::string> default_buildroot;
+ };
+
+ typedef ExtraDistributionData<GemsDistribution> GemsExtraDistributionData;
+ }
+}
+
+#endif
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 6ec4c24..6ab1d3c 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -23,6 +23,7 @@
#include <paludis/repositories/gems/gem_specification.hh>
#include <paludis/repositories/gems/gem_specifications.hh>
#include <paludis/repositories/gems/exceptions.hh>
+#include <paludis/repositories/gems/extra_distribution_data.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
@@ -382,7 +383,8 @@ GemsRepository::repository_factory_create(
std::string builddir(f("builddir"));
if (builddir.empty())
- builddir = (*DistributionData::get_instance()->distribution_from_string(env->distribution())).default_ebuild_builddir();
+ builddir = gems::GemsExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(env->distribution()))->default_buildroot();
return make_shared_ptr(new GemsRepository(gems::RepositoryParams::create()
.location(location)
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index fda9d7d..d24b0df 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/gems/gem_specification.hh>
#include <paludis/repositories/gems/yaml.hh>
#include <paludis/repositories/gems/exceptions.hh>
+#include <paludis/repositories/gems/extra_distribution_data.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/util/stringify.hh>
@@ -406,7 +407,8 @@ InstalledGemsRepository::repository_factory_create(
std::string builddir(f("builddir"));
if (builddir.empty())
- builddir = (*DistributionData::get_instance()->distribution_from_string(env->distribution())).default_ebuild_builddir();
+ builddir = gems::GemsExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(env->distribution()))->default_buildroot();
std::string root(f("root"));
if (root.empty())