aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-20 13:58:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-20 13:58:38 +0000
commit690aca7a8de4bf9b682be59abbed08a8d12a21d8 (patch)
tree74c37c1b81064c41dfff690cbaf53573d35bad77 /paludis/repositories
parentabc0d8ffc4ec1a5ecb75702c4b758027b059d657 (diff)
downloadpaludis-690aca7a8de4bf9b682be59abbed08a8d12a21d8.tar.gz
paludis-690aca7a8de4bf9b682be59abbed08a8d12a21d8.tar.xz
More sr -> kc work
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/e/Makefile.am26
-rw-r--r--paludis/repositories/e/vdb_merger.cc50
-rw-r--r--paludis/repositories/e/vdb_merger.hh22
-rw-r--r--paludis/repositories/e/vdb_merger.sr33
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc18
-rw-r--r--paludis/repositories/e/vdb_repository.cc32
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc63
-rw-r--r--paludis/repositories/e/vdb_unmerger.hh21
-rw-r--r--paludis/repositories/e/vdb_unmerger.sr30
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc14
10 files changed, 127 insertions, 182 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 1001c4f40..0b1eb2f30 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -7,8 +7,6 @@ DISTCLEANFILES = \
e_repository_params-se.hh e_repository_params-se.cc \
vdb_repository-sr.hh vdb_repository-sr.cc \
ebuild-sr.hh ebuild-sr.cc \
- vdb_merger-sr.hh vdb_merger-sr.cc \
- vdb_unmerger-sr.hh vdb_unmerger-sr.cc \
eapi-sr.hh eapi-sr.cc \
dep_parser-se.hh dep_parser-se.cc \
manifest2_entry-sr.hh manifest2_entry-sr.cc
@@ -91,11 +89,9 @@ paludis_repositories_e_include_HEADERS = \
use_requirements.hh \
vdb_contents_tokeniser.hh \
vdb_id.hh \
- vdb_merger-sr.hh \
vdb_merger.hh \
vdb_repository-sr.hh \
vdb_repository.hh \
- vdb_unmerger-sr.hh \
vdb_unmerger.hh
libpaludiserepository_la_SOURCES = \
@@ -362,12 +358,6 @@ EXTRA_DIST = \
vdb_repository-sr.hh \
vdb_repository-sr.cc \
vdb_repository.sr \
- vdb_merger.sr \
- vdb_merger-sr.hh \
- vdb_merger-sr.cc \
- vdb_unmerger.sr \
- vdb_unmerger-sr.hh \
- vdb_unmerger-sr.cc \
vdb_merger_TEST.cc \
vdb_merger_TEST_setup.sh \
vdb_merger_TEST_cleanup.sh \
@@ -392,10 +382,6 @@ BUILT_SOURCES = \
vdb_repository-sr.cc \
ebuild-sr.hh \
ebuild-sr.cc \
- vdb_merger-sr.hh \
- vdb_merger-sr.cc \
- vdb_unmerger-sr.hh \
- vdb_unmerger-sr.cc \
eapi-sr.hh \
eapi-sr.cc \
manifest2_entry-sr.hh \
@@ -447,18 +433,6 @@ manifest2_entry-sr.hh : manifest2_entry.sr $(top_srcdir)/misc/make_sr.bash
manifest2_entry-sr.cc : manifest2_entry.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --source $(srcdir)/manifest2_entry.sr > $@
-vdb_merger-sr.hh : vdb_merger.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/vdb_merger.sr > $@
-
-vdb_merger-sr.cc : vdb_merger.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/vdb_merger.sr > $@
-
-vdb_unmerger-sr.hh : vdb_unmerger.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/vdb_unmerger.sr > $@
-
-vdb_unmerger-sr.cc : vdb_unmerger.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/vdb_unmerger.sr > $@
-
ebuild-sr.hh : ebuild.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --header $(srcdir)/ebuild.sr > $@
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 3913cd7b7..b4f9d39c2 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -40,7 +40,7 @@
using namespace paludis;
-#include <paludis/repositories/e/vdb_merger-sr.cc>
+#include <iostream>
namespace paludis
{
@@ -56,21 +56,21 @@ namespace paludis
Implementation(const VDBMergerParams & p) :
params(p),
- realroot(params.root.realpath())
+ realroot(params[k::root()].realpath())
{
- tokenise_whitespace(p.config_protect, std::back_inserter(config_protect));
- tokenise_whitespace(p.config_protect_mask, std::back_inserter(config_protect_mask));
+ tokenise_whitespace(params[k::config_protect()], std::back_inserter(config_protect));
+ tokenise_whitespace(params[k::config_protect_mask()], std::back_inserter(config_protect_mask));
}
};
}
VDBMerger::VDBMerger(const VDBMergerParams & p) :
- Merger(MergerParams::create()
- .environment(p.environment)
- .image(p.image)
- .root(p.root)
- .no_chown(! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())
- .options(p.options)),
+ Merger(MergerParams::named_create()
+ (k::environment(), p[k::environment()])
+ (k::image(), p[k::image()])
+ (k::root(), p[k::root()])
+ (k::no_chown(), ! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())
+ (k::options(), p[k::options()])),
PrivateImplementationPattern<VDBMerger>(new Implementation<VDBMerger>(p))
{
}
@@ -82,33 +82,33 @@ VDBMerger::~VDBMerger()
Hook
VDBMerger::extend_hook(const Hook & h)
{
- tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params[k::environment()]->bashrc_files());
- if (_imp->params.package_id)
+ if (_imp->params[k::package_id()])
{
- std::string cat(stringify(_imp->params.package_id->name().category));
- std::string pn(stringify(_imp->params.package_id->name().package));
- std::string pvr(stringify(_imp->params.package_id->version()));
- std::string pv(stringify(_imp->params.package_id->version().remove_revision()));
- std::string slot(stringify(_imp->params.package_id->slot()));
+ std::string cat(stringify(_imp->params[k::package_id()]->name().category));
+ std::string pn(stringify(_imp->params[k::package_id()]->name().package));
+ std::string pvr(stringify(_imp->params[k::package_id()]->version()));
+ std::string pv(stringify(_imp->params[k::package_id()]->version().remove_revision()));
+ std::string slot(stringify(_imp->params[k::package_id()]->slot()));
return Merger::extend_hook(h)
("P", pn + "-" + pv)
("PN", pn)
("CATEGORY", cat)
- ("PR", _imp->params.package_id->version().revision_only())
+ ("PR", _imp->params[k::package_id()]->version().revision_only())
("PV", pv)
("PVR", pvr)
("PF", pn + "-" + pvr)
("SLOT", slot)
- ("CONFIG_PROTECT", _imp->params.config_protect)
- ("CONFIG_PROTECT_MASK", _imp->params.config_protect_mask)
+ ("CONFIG_PROTECT", _imp->params[k::config_protect()])
+ ("CONFIG_PROTECT_MASK", _imp->params[k::config_protect_mask()])
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
else
return Merger::extend_hook(h)
- ("CONFIG_PROTECT", _imp->params.config_protect)
- ("CONFIG_PROTECT_MASK", _imp->params.config_protect_mask)
+ ("CONFIG_PROTECT", _imp->params[k::config_protect()])
+ ("CONFIG_PROTECT_MASK", _imp->params[k::config_protect_mask()])
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
@@ -235,15 +235,15 @@ VDBMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
void
VDBMerger::merge()
{
- display_override(">>> Merging to " + stringify(_imp->params.root));
- _imp->contents_file.reset(new std::ofstream(stringify(_imp->params.contents_file).c_str()));
+ display_override(">>> Merging to " + stringify(_imp->params[k::root()]));
+ _imp->contents_file.reset(new std::ofstream(stringify(_imp->params[k::contents_file()]).c_str()));
Merger::merge();
}
bool
VDBMerger::check()
{
- std::cout << ">>> Checking whether we can merge to " << _imp->params.root << " ";
+ std::cout << ">>> Checking whether we can merge to " << _imp->params[k::root()] << " ";
bool result(Merger::check());
std::cout << std::endl;
return result;
diff --git a/paludis/repositories/e/vdb_merger.hh b/paludis/repositories/e/vdb_merger.hh
index 999bdd25d..2ff780da1 100644
--- a/paludis/repositories/e/vdb_merger.hh
+++ b/paludis/repositories/e/vdb_merger.hh
@@ -23,12 +23,32 @@
#include <paludis/merger.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/kc.hh>
+#include <paludis/util/keys.hh>
namespace paludis
{
class Hook;
-#include <paludis/repositories/e/vdb_merger-sr.hh>
+ /**
+ * Parameters for a VDBMerger.
+ *
+ * \see VDBMerger
+ * \ingroup grpmerger
+ * \ingroup grpvdbrepository
+ * \nosubgrouping
+ * \since 0.26
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::environment, Environment *>,
+ kc::Field<k::image, FSEntry>,
+ kc::Field<k::root, FSEntry>,
+ kc::Field<k::contents_file, FSEntry>,
+ kc::Field<k::config_protect, std::string>,
+ kc::Field<k::config_protect_mask, std::string>,
+ kc::Field<k::package_id, tr1::shared_ptr<const PackageID> >,
+ kc::Field<k::options, MergerOptions>
+ > VDBMergerParams;
/**
* Merger for VDBRepository.
diff --git a/paludis/repositories/e/vdb_merger.sr b/paludis/repositories/e/vdb_merger.sr
deleted file mode 100644
index 2e6cc110b..000000000
--- a/paludis/repositories/e/vdb_merger.sr
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_VDBMergerParams()
-{
- visible
-
- key environment "Environment *"
- key image "FSEntry"
- key root "FSEntry"
- key contents_file "FSEntry"
- key config_protect std::string
- key config_protect_mask std::string
- key package_id "tr1::shared_ptr<const PackageID>"
- key options "MergerOptions"
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * Parameters for a VDBMerger.
- *
- * \see VDBMerger
- * \ingroup grpmerger
- * \ingroup grpvdbrepository
- * \nosubgrouping
- * \since 0.26
- */
-END
-}
-
-
-
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index 5e4d36ecd..f568033e3 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -75,15 +75,15 @@ namespace
TestCase("merge '" + what + "' test"),
root_dir(FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "root"),
target(what),
- merger(VDBMergerParams::create()
- .environment(&env)
- .image(FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image")
- .root(root_dir)
- .contents_file(FSEntry::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what)
- .config_protect("/protected_file /protected_dir")
- .config_protect_mask("/protected_dir/unprotected_file /protected_dir/unprotected_dir")
- .package_id(tr1::shared_ptr<PackageID>())
- .options(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs))
+ merger(VDBMergerParams::named_create()
+ (k::environment(), &env)
+ (k::image(), FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image")
+ (k::root(), root_dir)
+ (k::contents_file(), FSEntry::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what)
+ (k::config_protect(), "/protected_file /protected_dir")
+ (k::config_protect_mask(), "/protected_dir/unprotected_file /protected_dir/unprotected_dir")
+ (k::package_id(), tr1::shared_ptr<PackageID>())
+ (k::options(), MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs))
{
}
};
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 83996c2d9..30066f315 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -397,13 +397,13 @@ VDBRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID> & id
/* unmerge */
VDBUnmerger unmerger(
- VDBUnmergerOptions::create()
- .environment(_imp->params.environment)
- .root(installed_root_key()->value())
- .contents_file(pkg_dir / "CONTENTS")
- .config_protect(config_protect)
- .config_protect_mask(config_protect_mask)
- .package_id(id));
+ VDBUnmergerOptions::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::root(), installed_root_key()->value())
+ (k::contents_file(), pkg_dir / "CONTENTS")
+ (k::config_protect(), config_protect)
+ (k::config_protect_mask(), config_protect_mask)
+ (k::package_id(), id));
unmerger.unmerge();
}
@@ -737,15 +737,15 @@ VDBRepository::merge(const MergeParams & m)
vdb_dir /= (stringify(m.package_id->name().package) + "-" + stringify(m.package_id->version()));
VDBMerger merger(
- VDBMergerParams::create()
- .environment(_imp->params.environment)
- .image(m.image_dir)
- .root(installed_root_key()->value())
- .contents_file(vdb_dir / "CONTENTS")
- .config_protect(config_protect)
- .config_protect_mask(config_protect_mask)
- .package_id(m.package_id)
- .options(m.options));
+ VDBMergerParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::image(), m.image_dir)
+ (k::root(), installed_root_key()->value())
+ (k::contents_file(), vdb_dir / "CONTENTS")
+ (k::config_protect(), config_protect)
+ (k::config_protect_mask(), config_protect_mask)
+ (k::package_id(), m.package_id)
+ (k::options(), m.options));
if (! merger.check())
{
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index be298d2c0..5acc4afb5 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.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
* Copyright (c) 2007 Piotr Jaroszyński
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -29,7 +29,6 @@ using namespace paludis;
#include <paludis/hook.hh>
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
-#include <paludis/repositories/e/vdb_unmerger-sr.cc>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -58,8 +57,8 @@ namespace paludis
Implementation(const VDBUnmergerOptions & o) :
options(o)
{
- tokenise_whitespace(o.config_protect, std::back_inserter(config_protect));
- tokenise_whitespace(o.config_protect_mask, std::back_inserter(config_protect_mask));
+ tokenise_whitespace(o[k::config_protect()], std::back_inserter(config_protect));
+ tokenise_whitespace(o[k::config_protect_mask()], std::back_inserter(config_protect_mask));
}
};
}
@@ -117,9 +116,9 @@ class VDBUnmerger::MiscExtraInfo :
};
VDBUnmerger::VDBUnmerger(const VDBUnmergerOptions & o) :
- Unmerger(UnmergerOptions::create()
- .environment(o.environment)
- .root(o.root)),
+ Unmerger(UnmergerOptions::named_create()
+ (k::environment(), o[k::environment()])
+ (k::root(), o[k::root()])),
PrivateImplementationPattern<VDBUnmerger>(new Implementation<VDBUnmerger>(o)),
_imp(PrivateImplementationPattern<VDBUnmerger>::_imp.get())
{
@@ -132,29 +131,29 @@ VDBUnmerger::~VDBUnmerger()
Hook
VDBUnmerger::extend_hook(const Hook & h) const
{
- tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options[k::environment()]->bashrc_files());
Hook result(Unmerger::extend_hook(h)
- ("CONFIG_PROTECT", _imp->options.config_protect)
- ("CONFIG_PROTECT_MASK", _imp->options.config_protect_mask)
+ ("CONFIG_PROTECT", _imp->options[k::config_protect()])
+ ("CONFIG_PROTECT_MASK", _imp->options[k::config_protect_mask()])
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " ")));
- if (_imp->options.package_id)
+ if (_imp->options[k::package_id()])
{
- std::string cat(stringify(_imp->options.package_id->name().category));
- std::string pn(stringify(_imp->options.package_id->name().package));
- std::string pvr(stringify(_imp->options.package_id->version()));
- std::string pv(stringify(_imp->options.package_id->version().remove_revision()));
+ std::string cat(stringify(_imp->options[k::package_id()]->name().category));
+ std::string pn(stringify(_imp->options[k::package_id()]->name().package));
+ std::string pvr(stringify(_imp->options[k::package_id()]->version()));
+ std::string pv(stringify(_imp->options[k::package_id()]->version().remove_revision()));
return result
("P", pn + "-" + pv)
("PN", pn)
("CATEGORY", cat)
- ("PR", _imp->options.package_id->version().revision_only())
+ ("PR", _imp->options[k::package_id()]->version().revision_only())
("PV", pv)
("PVR", pvr)
("PF", pn + "-" + pvr)
- ("SLOT", stringify(_imp->options.package_id->slot()));
+ ("SLOT", stringify(_imp->options[k::package_id()]->slot()));
}
return result;
@@ -188,7 +187,7 @@ VDBUnmerger::config_protected(const FSEntry & f) const
std::string
VDBUnmerger::make_tidy(const FSEntry & f) const
{
- std::string root_str(stringify(_imp->options.root)), f_str(stringify(f));
+ std::string root_str(stringify(_imp->options[k::root()])), f_str(stringify(f));
if (root_str == "/")
root_str.clear();
if (0 != f_str.compare(0, root_str.length(), root_str))
@@ -199,9 +198,9 @@ VDBUnmerger::make_tidy(const FSEntry & f) const
void
VDBUnmerger::populate_unmerge_set()
{
- std::ifstream c(stringify(_imp->options.contents_file).c_str());
+ std::ifstream c(stringify(_imp->options[k::contents_file()]).c_str());
if (! c)
- throw VDBUnmergerError("Cannot read '" + stringify(_imp->options.contents_file) + "'");
+ throw VDBUnmergerError("Cannot read '" + stringify(_imp->options[k::contents_file()]) + "'");
std::string line;
while (std::getline(c, line))
@@ -251,22 +250,22 @@ VDBUnmerger::check_file(const FSEntry & f, tr1::shared_ptr<ExtraInfo> ei) const
{
tr1::shared_ptr<FileExtraInfo> fie(tr1::static_pointer_cast<FileExtraInfo>(ei));
- if (! (_imp->options.root / f).is_regular_file())
+ if (! (_imp->options[k::root()] / f).is_regular_file())
display("--- [!type] " + stringify(f));
- else if ((_imp->options.root / f).mtime() != fie->_mtime)
+ else if ((_imp->options[k::root()] / f).mtime() != fie->_mtime)
display("--- [!time] " + stringify(f));
else
{
- std::ifstream md5_file(stringify(_imp->options.root / f).c_str());
+ std::ifstream md5_file(stringify(_imp->options[k::root()] / f).c_str());
if (! md5_file)
{
Log::get_instance()->message(ll_warning, lc_no_context, "Cannot get md5 for '" +
- stringify(_imp->options.root / f) + "'");
+ stringify(_imp->options[k::root()] / f) + "'");
display("--- [!md5?] " + stringify(f));
}
else if (MD5(md5_file).hexsum() != fie->_md5sum)
display("--- [!md5 ] " + stringify(f));
- else if (config_protected(_imp->options.root / f))
+ else if (config_protected(_imp->options[k::root()] / f))
display("--- [cfgpr] " + stringify(f));
else
return true;
@@ -280,11 +279,11 @@ VDBUnmerger::check_sym(const FSEntry & f, tr1::shared_ptr<ExtraInfo> ei) const
{
tr1::shared_ptr<SymlinkExtraInfo> sie(tr1::static_pointer_cast<SymlinkExtraInfo>(ei));
- if (! (_imp->options.root / f).is_symbolic_link())
+ if (! (_imp->options[k::root()] / f).is_symbolic_link())
display("--- [!type] " + stringify(f));
- else if ((_imp->options.root / f).mtime() != sie->_mtime)
+ else if ((_imp->options[k::root()] / f).mtime() != sie->_mtime)
display("--- [!time] " + stringify(f));
- else if ((_imp->options.root / f).readlink() != sie->_dest)
+ else if ((_imp->options[k::root()] / f).readlink() != sie->_dest)
display("--- [!dest] " + stringify(f));
else
return true;
@@ -297,9 +296,9 @@ VDBUnmerger::check_misc(const FSEntry & f, tr1::shared_ptr<ExtraInfo> ei) const
{
tr1::shared_ptr<MiscExtraInfo> mie(tr1::static_pointer_cast<MiscExtraInfo>(ei));
- if ("fif" == mie->_type && ! (_imp->options.root / f).is_fifo())
+ if ("fif" == mie->_type && ! (_imp->options[k::root()] / f).is_fifo())
display("--- [!type] " + stringify(f));
- else if ("dev" == mie->_type && ! (_imp->options.root / f).is_device())
+ else if ("dev" == mie->_type && ! (_imp->options[k::root()] / f).is_device())
display("--- [!type] " + stringify(f));
else
return true;
@@ -310,9 +309,9 @@ VDBUnmerger::check_misc(const FSEntry & f, tr1::shared_ptr<ExtraInfo> ei) const
bool
VDBUnmerger::check_dir(const FSEntry & f, tr1::shared_ptr<ExtraInfo>) const
{
- if (! (_imp->options.root / f).is_directory())
+ if (! (_imp->options[k::root()] / f).is_directory())
display("--- [!type] " + stringify(f));
- else if (DirIterator(_imp->options.root / f, DirIteratorOptions() + dio_include_dotfiles + dio_first_only) != DirIterator())
+ else if (DirIterator(_imp->options[k::root()] / f, DirIteratorOptions() + dio_include_dotfiles + dio_first_only) != DirIterator())
display("--- [!empt] " + stringify(f));
else
return true;
diff --git a/paludis/repositories/e/vdb_unmerger.hh b/paludis/repositories/e/vdb_unmerger.hh
index 892b97fdc..8520e9178 100644
--- a/paludis/repositories/e/vdb_unmerger.hh
+++ b/paludis/repositories/e/vdb_unmerger.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
* Copyright (c) 2007 Piotr Jaroszyński
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -22,8 +22,9 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_VDB_UNMERGER_HH 1
#include <paludis/repository.hh>
+#include <paludis/util/kc.hh>
+#include <paludis/util/keys.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/sr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/unmerger.hh>
@@ -31,7 +32,21 @@ namespace paludis
{
class Environment;
-#include <paludis/repositories/e/vdb_unmerger-sr.hh>
+ /**
+ * Options for a VDBUnmerger.
+ *
+ * \see VDBUnmerger
+ * \ingroup grpvdbrepository
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::environment, Environment *>,
+ kc::Field<k::root, FSEntry>,
+ kc::Field<k::contents_file, FSEntry>,
+ kc::Field<k::config_protect, std::string>,
+ kc::Field<k::config_protect_mask, std::string>,
+ kc::Field<k::package_id, tr1::shared_ptr<const PackageID> >
+ > VDBUnmergerOptions;
/**
* Thrown if an unmerge from a VDBRepository using VDBUnmerger fails.
diff --git a/paludis/repositories/e/vdb_unmerger.sr b/paludis/repositories/e/vdb_unmerger.sr
deleted file mode 100644
index ea070b6dc..000000000
--- a/paludis/repositories/e/vdb_unmerger.sr
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_VDBUnmergerOptions()
-{
- visible
-
- key environment "Environment *"
- key root "FSEntry"
- key contents_file "FSEntry"
- key config_protect std::string
- key config_protect_mask std::string
- key package_id "tr1::shared_ptr<const PackageID>"
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * Options for a VDBUnmerger.
- *
- * \see VDBUnmerger
- * \ingroup grpvdbrepository
- * \nosubgrouping
- */
-END
-}
-
-
-
-
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index 7036ec85f..f385c74f9 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -66,13 +66,13 @@ namespace
TestCase("unmerge '" + what + "' test"),
root_dir("vdb_unmerger_TEST_dir/root"),
target(what),
- unmerger(VDBUnmergerOptions::create()
- .environment(&env)
- .root(root_dir)
- .contents_file("vdb_unmerger_TEST_dir/CONTENTS/" + what)
- .config_protect("/protected_file /protected_dir")
- .config_protect_mask("/protected_dir/unprotected_file /protected_dir/unprotected_dir")
- .package_id(tr1::shared_ptr<PackageID>()))
+ unmerger(VDBUnmergerOptions::named_create()
+ (k::environment(), &env)
+ (k::root(), root_dir)
+ (k::contents_file(), "vdb_unmerger_TEST_dir/CONTENTS/" + what)
+ (k::config_protect(), "/protected_file /protected_dir")
+ (k::config_protect_mask(), "/protected_dir/unprotected_file /protected_dir/unprotected_dir")
+ (k::package_id(), tr1::shared_ptr<PackageID>()))
{
}
};