aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 00:10:33 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 00:10:33 +0000
commitae39fcba8a7354fe31e73f8ee6b6898356260524 (patch)
treed6aaa5ce90e114680a84edebc027d9488c1020f5
parent25dad978006d69b4c42c7ae1188533438c28ce71 (diff)
downloadpaludis-ae39fcba8a7354fe31e73f8ee6b6898356260524.tar.gz
paludis-ae39fcba8a7354fe31e73f8ee6b6898356260524.tar.xz
more dead sr
-rw-r--r--paludis/repositories/gems/Makefile.am17
-rw-r--r--paludis/repositories/gems/gems_repository.cc33
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc23
-rw-r--r--paludis/repositories/gems/params.cc4
-rw-r--r--paludis/repositories/gems/params.hh33
-rw-r--r--paludis/repositories/gems/params.sr29
6 files changed, 61 insertions, 78 deletions
diff --git a/paludis/repositories/gems/Makefile.am b/paludis/repositories/gems/Makefile.am
index 78e5b58..349efda 100644
--- a/paludis/repositories/gems/Makefile.am
+++ b/paludis/repositories/gems/Makefile.am
@@ -1,6 +1,5 @@
SUBDIRS = .
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.loT *.epicfail
-DISTCLEANFILES = params-sr.hh params-sr.cc
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = -I$(top_srcdir) -I$(top_builddir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
@@ -25,7 +24,7 @@ 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 \
extra_distribution_data.hh
libpaludisgemsrepository_@PALUDIS_PC_SLOT@_la_SOURCES = \
@@ -111,13 +110,7 @@ EXTRA_DIST = \
gems_repository_TEST_cleanup.sh \
yaml_TEST.cc \
gem_specification_TEST.cc \
- gem_specifications_TEST.cc \
- params-sr.hh \
- params-sr.cc \
- params.sr
-
-BUILT_SOURCES = \
- params-sr.hh params-sr.cc
+ gem_specifications_TEST.cc
check_SCRIPTS = \
gems_repository_TEST_setup.sh gems_repository_TEST_cleanup.sh
@@ -144,12 +137,6 @@ check_PROGRAMS = $(TESTS)
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-params-sr.hh : params.sr $(top_srcdir)/misc/make_sr.bash
- if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/params.sr > $@ ; then rm -f $@ ; exit 1 ; fi
-
-params-sr.cc : params.sr $(top_srcdir)/misc/make_sr.bash
- if ! $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/params.sr > $@ ; then rm -f $@ ; exit 1 ; fi
-
distcheck-deps-local : $(DISTCHECK_DEPS)
distcheck-deps : distcheck-deps-subdirs
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 843cce2..d061c22 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -73,15 +73,15 @@ namespace paludis
has_category_names(false),
has_ids(false),
location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
- mkt_significant, params.location)),
+ mkt_significant, params.location())),
install_dir_key(new LiteralMetadataValueKey<FSEntry> ("install_dir", "install_dir",
- mkt_normal, params.install_dir)),
+ mkt_normal, params.install_dir())),
builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
- mkt_normal, params.builddir)),
+ mkt_normal, params.builddir())),
sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync",
- mkt_normal, params.sync)),
+ mkt_normal, params.sync())),
sync_options_key(new LiteralMetadataValueKey<std::string> (
- "sync_options", "sync_options", mkt_normal, params.sync_options)),
+ "sync_options", "sync_options", mkt_normal, params.sync_options())),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "gems"))
{
@@ -90,7 +90,7 @@ namespace paludis
}
GemsRepository::GemsRepository(const gems::RepositoryParams & params) :
- Repository(params.environment, RepositoryName("gems"),
+ Repository(params.environment(), RepositoryName("gems"),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
@@ -244,13 +244,13 @@ GemsRepository::need_ids() const
Context context("When loading gems yaml file:");
- std::ifstream yaml_file(stringify(_imp->params.location / "yaml").c_str());
+ std::ifstream yaml_file(stringify(_imp->params.location() / "yaml").c_str());
if (! yaml_file)
- throw ConfigurationError("Gems yaml file '" + stringify(_imp->params.location / "yaml") + "' not readable");
+ throw ConfigurationError("Gems yaml file '" + stringify(_imp->params.location() / "yaml") + "' not readable");
std::string output((std::istreambuf_iterator<char>(yaml_file)), std::istreambuf_iterator<char>());
yaml::Document master_doc(output);
- gems::GemSpecifications specs(_imp->params.environment, shared_from_this(), *master_doc.top());
+ gems::GemSpecifications specs(_imp->params.environment(), shared_from_this(), *master_doc.top());
for (gems::GemSpecifications::ConstIterator i(specs.begin()), i_end(specs.end()) ;
i != i_end ; ++i)
@@ -385,13 +385,14 @@ GemsRepository::repository_factory_create(
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)
- .sync(sync)
- .sync_options(sync_options)
- .environment(env)
- .install_dir(install_dir)
- .builddir(builddir)));
+ return make_shared_ptr(new GemsRepository(make_named_values<gems::RepositoryParams>(
+ value_for<n::builddir>(builddir),
+ value_for<n::environment>(env),
+ value_for<n::install_dir>(install_dir),
+ value_for<n::location>(location),
+ value_for<n::sync>(sync),
+ value_for<n::sync_options>(sync_options)
+ )));
}
RepositoryName
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 6d2b171..a62e990 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -76,11 +76,11 @@ namespace paludis
has_category_names(false),
has_ids(false),
install_dir_key(new LiteralMetadataValueKey<FSEntry> ("install_dir", "install_dir",
- mkt_normal, params.install_dir)),
+ mkt_normal, params.install_dir())),
builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
- mkt_normal, params.builddir)),
+ mkt_normal, params.builddir())),
root_key(new LiteralMetadataValueKey<FSEntry> (
- "root", "root", mkt_normal, params.root)),
+ "root", "root", mkt_normal, params.root())),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "gems"))
{
@@ -89,7 +89,7 @@ namespace paludis
}
InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepositoryParams & params) :
- Repository(params.environment,
+ Repository(params.environment(),
RepositoryName("installed-gems"),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
@@ -234,7 +234,7 @@ InstalledGemsRepository::need_ids() const
std::tr1::shared_ptr<QualifiedPackageNameSet> pkgs(new QualifiedPackageNameSet);
_imp->package_names.insert(std::make_pair(gems, pkgs));
- for (DirIterator d(_imp->params.install_dir / "specifications"), d_end ; d != d_end ; ++d)
+ for (DirIterator d(_imp->params.install_dir() / "specifications"), d_end ; d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".gemspec", IsFileWithOptions()))
continue;
@@ -255,7 +255,7 @@ InstalledGemsRepository::need_ids() const
if (_imp->ids.end() == _imp->ids.find(gems + p))
_imp->ids.insert(std::make_pair(gems + p, make_shared_ptr(new PackageIDSequence)));
_imp->ids.find(gems + p)->second->push_back(make_shared_ptr(new gems::GemSpecification(
- _imp->params.environment, shared_from_this(), p, v, *d)));
+ _imp->params.environment(), shared_from_this(), p, v, *d)));
}
}
@@ -414,10 +414,11 @@ InstalledGemsRepository::repository_factory_create(
if (root.empty())
root = "/";
- return make_shared_ptr(new InstalledGemsRepository(gems::InstalledRepositoryParams::create()
- .environment(env)
- .install_dir(install_dir)
- .root(root)
- .builddir(builddir)));
+ return make_shared_ptr(new InstalledGemsRepository(make_named_values<gems::InstalledRepositoryParams>(
+ value_for<n::builddir>(builddir),
+ value_for<n::environment>(env),
+ value_for<n::install_dir>(install_dir),
+ value_for<n::root>(root)
+ )));
}
diff --git a/paludis/repositories/gems/params.cc b/paludis/repositories/gems/params.cc
index 69a67e9..df89864 100644
--- a/paludis/repositories/gems/params.cc
+++ b/paludis/repositories/gems/params.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 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
@@ -22,5 +22,3 @@
using namespace paludis;
using namespace paludis::gems;
-#include <paludis/repositories/gems/params-sr.cc>
-
diff --git a/paludis/repositories/gems/params.hh b/paludis/repositories/gems/params.hh
index 06e11f6..2d6d88f 100644
--- a/paludis/repositories/gems/params.hh
+++ b/paludis/repositories/gems/params.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 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
@@ -23,18 +23,43 @@
#include <paludis/repositories/gems/params-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/sr.hh>
+#include <paludis/util/named_value.hh>
#include <string>
namespace paludis
{
class Environment;
- namespace gems
+ namespace n
{
+ struct builddir;
+ struct environment;
+ struct install_dir;
+ struct location;
+ struct root;
+ struct sync;
+ struct sync_options;
+ }
-#include <paludis/repositories/gems/params-sr.hh>
+ namespace gems
+ {
+ struct RepositoryParams
+ {
+ NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::install_dir, FSEntry> install_dir;
+ NamedValue<n::location, FSEntry> location;
+ NamedValue<n::sync, std::string> sync;
+ NamedValue<n::sync_options, std::string> sync_options;
+ };
+ struct InstalledRepositoryParams
+ {
+ NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::install_dir, FSEntry> install_dir;
+ NamedValue<n::root, FSEntry> root;
+ };
}
}
diff --git a/paludis/repositories/gems/params.sr b/paludis/repositories/gems/params.sr
deleted file mode 100644
index 2967785..0000000
--- a/paludis/repositories/gems/params.sr
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-make_class_RepositoryParams()
-{
- visible
-
- key environment "Environment *"
- key location FSEntry
- key install_dir FSEntry
- key sync std::string
- key sync_options std::string
- key builddir FSEntry
-
- allow_named_args
-}
-
-make_class_InstalledRepositoryParams()
-{
- visible
-
- key environment "Environment *"
- key builddir FSEntry
- key install_dir FSEntry
- key root FSEntry
-
- allow_named_args
-}
-