aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/gems
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/gems')
-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
5 files changed, 104 insertions, 3 deletions
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())