aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 21:09:11 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 21:09:11 +0000
commit1577c6854e2aada16759ba96baf7f323744a0e99 (patch)
tree225ae103aeebaca729fd1f5b2a5c1946255dd297
parentd6c5459b86ebd17951b3e9ddfb728c457c2e43c1 (diff)
downloadpaludis-1577c6854e2aada16759ba96baf7f323744a0e99.tar.gz
paludis-1577c6854e2aada16759ba96baf7f323744a0e99.tar.xz
kill more sr
-rw-r--r--paludis/repositories/cran/Makefile.am27
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc19
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh20
-rw-r--r--paludis/repositories/cran/cran_installed_repository.sr24
-rw-r--r--paludis/repositories/cran/cran_repository.cc55
-rw-r--r--paludis/repositories/cran/cran_repository.hh29
-rw-r--r--paludis/repositories/cran/cran_repository.sr28
7 files changed, 83 insertions, 119 deletions
diff --git a/paludis/repositories/cran/Makefile.am b/paludis/repositories/cran/Makefile.am
index 9d6e319..696465e 100644
--- a/paludis/repositories/cran/Makefile.am
+++ b/paludis/repositories/cran/Makefile.am
@@ -1,6 +1,5 @@
SUBDIRS = cran .
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.loT *.epicfail
-DISTCLEANFILES = cran_repository-sr.hh cran_repository-sr.cc
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
@@ -29,9 +28,7 @@ paludis_repositories_cran_include_HEADERS = \
cran_package_id.hh \
cran_dep_parser.hh \
cran_repository.hh \
- cran_repository-sr.hh \
cran_installed_repository.hh \
- cran_installed_repository-sr.hh \
description_file.hh \
masks.hh \
keys.hh \
@@ -108,22 +105,10 @@ EXTRA_DIST = \
cran_repository_TEST.cc \
cran_repository_TEST_setup.sh \
cran_repository_TEST_cleanup.sh \
- cran_repository.sr \
- cran_repository-sr.hh \
- cran_repository-sr.cc \
- cran_installed_repository.sr \
- cran_installed_repository-sr.hh \
- cran_installed_repository-sr.cc \
cran_installed_repository_TEST.cc \
cran_installed_repository_TEST_setup.sh \
cran_installed_repository_TEST_cleanup.sh
-BUILT_SOURCES = \
- cran_repository-sr.hh \
- cran_repository-sr.cc \
- cran_installed_repository-sr.hh \
- cran_installed_repository-sr.cc
-
check_PROGRAMS = $(TESTS)
check_SCRIPTS = \
cran_repository_TEST_setup.sh cran_repository_TEST_cleanup.sh \
@@ -139,18 +124,6 @@ TESTS_ENVIRONMENT = env \
PALUDIS_REPOSITORY_SO_DIR="$(top_builddir)/paludis/repositories" \
bash $(top_srcdir)/test/run_test.sh
-cran_repository-sr.hh : cran_repository.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/cran_repository.sr > $@
-
-cran_repository-sr.cc : cran_repository.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/cran_repository.sr > $@
-
-cran_installed_repository-sr.hh : cran_installed_repository.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/cran_installed_repository.sr > $@
-
-cran_installed_repository-sr.cc : cran_installed_repository.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/cran_installed_repository.sr > $@
-
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index da98e99..6f11919 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -53,8 +53,6 @@
using namespace paludis;
-#include <paludis/repositories/cran/cran_installed_repository-sr.cc>
-
typedef std::tr1::unordered_map<
QualifiedPackageName,
std::tr1::shared_ptr<const cranrepository::CRANPackageID>,
@@ -82,8 +80,8 @@ namespace paludis
Implementation<CRANInstalledRepository>::Implementation(const CRANInstalledRepositoryParams & p) :
params(p),
has_ids(false),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location)),
- installed_root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root", mkt_normal, params.root)),
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location())),
+ installed_root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root", mkt_normal, params.root())),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "installed_cran"))
{
}
@@ -158,7 +156,7 @@ Implementation<CRANInstalledRepository>::need_ids() const
CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryParams & p) :
Repository(
- p.environment,
+ p.environment(),
RepositoryName("installed-cran"),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
@@ -391,10 +389,11 @@ CRANInstalledRepository::repository_factory_create(
if (! f("world").empty())
throw CRANInstalledRepositoryConfigurationError("Key 'world' is no longer supported.");
- return std::tr1::shared_ptr<Repository>(new CRANInstalledRepository(CRANInstalledRepositoryParams::create()
- .environment(env)
- .location(location)
- .root(root)));
+ return std::tr1::shared_ptr<Repository>(new CRANInstalledRepository(make_named_values<CRANInstalledRepositoryParams>(
+ value_for<n::environment>(env),
+ value_for<n::location>(location),
+ value_for<n::root>(root)
+ )));
}
RepositoryName
@@ -505,7 +504,7 @@ CRANInstalledRepository::is_suitable_destination_for(const PackageID & e) const
bool
CRANInstalledRepository::is_default_destination() const
{
- return _imp->params.environment->root() == installed_root_key()->value();
+ return _imp->params.environment()->root() == installed_root_key()->value();
}
bool
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 48caa82..f7a63dc 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -35,8 +35,26 @@
namespace paludis
{
+ namespace n
+ {
+ struct environment;
+ struct location;
+ struct root;
+ }
-#include <paludis/repositories/cran/cran_installed_repository-sr.hh>
+ /**
+ * Parameters used to create a CRANInstalledRepository
+ *
+ * \see CRANInstalledRepository
+ * \ingroup grpcraninstrepository
+ * \nosubgrouping
+ */
+ struct CRANInstalledRepositoryParams
+ {
+ NamedValue<n::environment, const Environment *> environment;
+ NamedValue<n::location, FSEntry> location;
+ NamedValue<n::root, FSEntry> root;
+ };
/**
* A CRANInstalledRepository represents the database used for
diff --git a/paludis/repositories/cran/cran_installed_repository.sr b/paludis/repositories/cran/cran_installed_repository.sr
deleted file mode 100644
index 3b56196..0000000
--- a/paludis/repositories/cran/cran_installed_repository.sr
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-make_class_CRANInstalledRepositoryParams()
-{
- visible
-
- key environment "const Environment *"
- key location FSEntry
- key root FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters used to create a CRANInstalledRepository
- *
- * \see CRANInstalledRepository
- * \ingroup grpcraninstrepository
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index c9f1785..b2bf144 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -54,8 +54,6 @@
using namespace paludis;
-#include <paludis/repositories/cran/cran_repository-sr.cc>
-
typedef std::tr1::unordered_map<
QualifiedPackageName,
std::tr1::shared_ptr<const cranrepository::CRANPackageID>,
@@ -89,12 +87,12 @@ Implementation<CRANRepository>::Implementation(const CRANRepositoryParams & p, c
params(p),
big_nasty_mutex(m),
has_ids(false),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location)),
- distdir_key(new LiteralMetadataValueKey<FSEntry> ("distdir", "distdir", mkt_normal, params.distdir)),
+ location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location())),
+ distdir_key(new LiteralMetadataValueKey<FSEntry> ("distdir", "distdir", mkt_normal, params.distdir())),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "cran")),
- builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir", mkt_normal, params.builddir)),
- library_key(new LiteralMetadataValueKey<FSEntry> ("library", "library", mkt_normal, params.library)),
- sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync", mkt_normal, params.sync))
+ builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir", mkt_normal, params.builddir())),
+ library_key(new LiteralMetadataValueKey<FSEntry> ("library", "library", mkt_normal, params.library())),
+ sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync", mkt_normal, params.sync()))
{
}
@@ -105,8 +103,8 @@ Implementation<CRANRepository>::~Implementation()
CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
Repository(
- p.environment,
- CRANRepository::fetch_repo_name(stringify(p.location)),
+ p.environment(),
+ CRANRepository::fetch_repo_name(stringify(p.location())),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
@@ -222,10 +220,10 @@ CRANRepository::need_ids() const
Context context("When loading IDs for " + stringify(name()) + ":");
- for (DirIterator d(_imp->params.location), d_end ; d != d_end ; ++d)
+ for (DirIterator d(_imp->params.location()), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".DESCRIPTION", IsFileWithOptions()))
{
- std::tr1::shared_ptr<cranrepository::CRANPackageID> id(new cranrepository::CRANPackageID(_imp->params.environment,
+ std::tr1::shared_ptr<cranrepository::CRANPackageID> id(new cranrepository::CRANPackageID(_imp->params.environment(),
shared_from_this(), *d));
if (! _imp->ids.insert(std::make_pair(id->name(), id)).second)
Log::get_instance()->message("cran.id.duplicate", ll_warning, lc_context)
@@ -376,9 +374,9 @@ CRANRepository::sync(const std::tr1::shared_ptr<const OutputDeviant> & output_de
Lock l(*_imp->big_nasty_mutex);
std::string cmd("rsync --delete --recursive --progress --exclude \"*.html\" --exclude \"*.INDEX\" '" +
- _imp->params.sync + "/src/contrib/Descriptions/' ./");
+ _imp->params.sync() + "/src/contrib/Descriptions/' ./");
- Command command1(Command(cmd).with_chdir(_imp->params.location));
+ Command command1(Command(cmd).with_chdir(_imp->params.location()));
if (output_deviant)
command1
@@ -393,11 +391,11 @@ CRANRepository::sync(const std::tr1::shared_ptr<const OutputDeviant> & output_de
;
if (0 != run_command(command1))
- throw SyncFailedError(stringify(_imp->params.location), _imp->params.sync);
+ throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
- cmd = "rsync --progress '" + _imp->params.sync + "/src/contrib/PACKAGES' ./";
+ cmd = "rsync --progress '" + _imp->params.sync() + "/src/contrib/PACKAGES' ./";
- Command command2(Command(cmd).with_chdir(_imp->params.location));
+ Command command2(Command(cmd).with_chdir(_imp->params.location()));
if (output_deviant)
command2
@@ -412,11 +410,11 @@ CRANRepository::sync(const std::tr1::shared_ptr<const OutputDeviant> & output_de
;
if (0 != run_command(command2))
- throw SyncFailedError(stringify(_imp->params.location), _imp->params.sync);
+ throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
- cmd = "rsync --progress '" + _imp->params.sync + "/CRAN_mirrors.csv' ./";
+ cmd = "rsync --progress '" + _imp->params.sync() + "/CRAN_mirrors.csv' ./";
- Command command3(Command(cmd).with_chdir(_imp->params.location));
+ Command command3(Command(cmd).with_chdir(_imp->params.location()));
if (output_deviant)
command3
@@ -431,7 +429,7 @@ CRANRepository::sync(const std::tr1::shared_ptr<const OutputDeviant> & output_de
;
if (0 != run_command(command3))
- throw SyncFailedError(stringify(_imp->params.location), _imp->params.sync);
+ throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
return true;
}
@@ -467,14 +465,15 @@ CRANRepository::repository_factory_create(
if (builddir.empty())
builddir = "/var/tmp/paludis";
- return std::tr1::shared_ptr<Repository>(new CRANRepository(CRANRepositoryParams::create()
- .environment(env)
- .location(location)
- .distdir(distdir)
- .sync(sync)
- .builddir(builddir)
- .library(library)
- .mirror(mirror)));
+ return std::tr1::shared_ptr<Repository>(new CRANRepository(make_named_values<CRANRepositoryParams>(
+ value_for<n::builddir>(builddir),
+ value_for<n::distdir>(distdir),
+ value_for<n::environment>(env),
+ value_for<n::library>(library),
+ value_for<n::location>(location),
+ value_for<n::mirror>(mirror),
+ value_for<n::sync>(sync)
+ )));
}
RepositoryName
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 6155165..b84c1fd 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -38,7 +38,34 @@ namespace paludis
{
class PackageDatabase;
-#include <paludis/repositories/cran/cran_repository-sr.hh>
+ namespace n
+ {
+ struct builddir;
+ struct distdir;
+ struct environment;
+ struct library;
+ struct location;
+ struct mirror;
+ struct sync;
+ }
+
+ /**
+ * Parameters used to create a CRANRepository
+ *
+ * \see CRANRepository
+ * \ingroup grpcranrepository
+ * \nosubgrouping
+ */
+ struct CRANRepositoryParams
+ {
+ NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::distdir, FSEntry> distdir;
+ NamedValue<n::environment, const Environment *> environment;
+ NamedValue<n::library, FSEntry> library;
+ NamedValue<n::location, FSEntry> location;
+ NamedValue<n::mirror, std::string> mirror;
+ NamedValue<n::sync, std::string> sync;
+ };
/**
* A CRANRepository is a Repository that handles the layout used by
diff --git a/paludis/repositories/cran/cran_repository.sr b/paludis/repositories/cran/cran_repository.sr
deleted file mode 100644
index 6da3346..0000000
--- a/paludis/repositories/cran/cran_repository.sr
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-make_class_CRANRepositoryParams()
-{
- visible
-
- key environment "const Environment *"
- key location FSEntry
- key distdir FSEntry
- key mirror std::string
- key sync std::string
- key builddir FSEntry
- key library FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters used to create a CRANRepository
- *
- * \see CRANRepository
- * \ingroup grpcranrepository
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-