aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 20:16:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-08 20:16:17 +0000
commit903ff5be1f3b164db5a8c66714831c9687d1c1c2 (patch)
tree9802d34606c33be1e7412c64edd02a2fdfd2d593
parentf39658e408fe92f259a1594fccc1b12c96f5a242 (diff)
downloadpaludis-903ff5be1f3b164db5a8c66714831c9687d1c1c2.tar.gz
paludis-903ff5be1f3b164db5a8c66714831c9687d1c1c2.tar.xz
kill more sr
-rw-r--r--paludis/environments/no_config/Makefile.am15
-rw-r--r--paludis/environments/no_config/no_config_environment.cc57
-rw-r--r--paludis/environments/no_config/no_config_environment.hh34
-rw-r--r--paludis/environments/no_config/no_config_environment.sr29
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc22
-rw-r--r--paludis/environments/no_config/registration.cc23
-rw-r--r--python/environment.cc16
-rw-r--r--ruby/environment.cc22
-rw-r--r--src/clients/accerso/accerso.cc21
-rw-r--r--src/clients/adjutrix/adjutrix.cc25
-rw-r--r--src/clients/instruo/instruo.cc22
-rw-r--r--src/clients/qualudis/qualudis.cc22
12 files changed, 156 insertions, 152 deletions
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am
index 0f35af1..f1dae03 100644
--- a/paludis/environments/no_config/Makefile.am
+++ b/paludis/environments/no_config/Makefile.am
@@ -1,6 +1,5 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.loT ihateautomake.cc ihateautomake.o *.epicfail
-DISTCLEANFILES = no_config_environment-sr.hh no_config_environment-sr.cc no_config_environment-se.hh \
- no_config_environment-se.cc
+DISTCLEANFILES = no_config_environment-se.hh no_config_environment-se.cc
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
DEFS= \
@@ -25,13 +24,9 @@ libenv_LTLIBRARIES = libpaludisnoconfigenvironment_@PALUDIS_PC_SLOT@.la
paludis_environment_no_config_includedir = $(includedir)/paludis-$(PALUDIS_PC_SLOT)/paludis/environments/no_config
paludis_environment_no_config_include_HEADERS = \
no_config_environment.hh \
- no_config_environment-sr.hh \
no_config_environment-se.hh
EXTRA_DIST = \
- no_config_environment-sr.hh \
- no_config_environment-sr.cc \
- no_config_environment.sr \
no_config_environment-se.hh \
no_config_environment-se.cc \
no_config_environment.se \
@@ -66,17 +61,9 @@ no_config_environment_TEST_LDADD = \
$(DYNAMIC_LD_LIBS)
BUILT_SOURCES = \
- no_config_environment-sr.hh \
- no_config_environment-sr.cc \
no_config_environment-se.hh \
no_config_environment-se.cc
-no_config_environment-sr.hh : no_config_environment.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/no_config_environment.sr > $@
-
-no_config_environment-sr.cc : no_config_environment.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/no_config_environment.sr > $@
-
no_config_environment-se.hh : no_config_environment.se $(top_srcdir)/misc/make_se.bash
$(top_srcdir)/misc/make_se.bash --header $(srcdir)/no_config_environment.se > $@
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index ffa52d6..bfefe13 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -46,7 +46,6 @@
using namespace paludis;
using namespace paludis::no_config_environment;
-#include <paludis/environments/no_config/no_config_environment-sr.cc>
#include <paludis/environments/no_config/no_config_environment-se.cc>
namespace paludis
@@ -150,30 +149,30 @@ namespace
Implementation<NoConfigEnvironment>::Implementation(
NoConfigEnvironment * const env, const no_config_environment::Params & p) :
params(p),
- top_level_dir(p.repository_dir),
- write_cache(p.write_cache),
- accept_unstable(p.accept_unstable),
- is_vdb(is_vdb_repository(p.repository_dir, p.repository_type)),
+ top_level_dir(p.repository_dir()),
+ write_cache(p.write_cache()),
+ accept_unstable(p.accept_unstable()),
+ is_vdb(is_vdb_repository(p.repository_dir(), p.repository_type())),
paludis_command("false"),
package_database(new PackageDatabase(env)),
format_key(new LiteralMetadataValueKey<std::string>("format", "Format", mkt_significant, "no_config")),
repository_dir_key(new LiteralMetadataValueKey<FSEntry>("repository_dir", "Repository dir",
- mkt_normal, p.repository_dir))
+ mkt_normal, p.repository_dir()))
{
}
void
Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
{
- Context context("When initialising NoConfigEnvironment at '" + stringify(params.repository_dir) + "':");
+ Context context("When initialising NoConfigEnvironment at '" + stringify(params.repository_dir()) + "':");
if (! is_vdb)
{
bool ignored_one(false);
- for (FSEntrySequence::ConstIterator d(params.extra_repository_dirs->begin()), d_end(params.extra_repository_dirs->end()) ;
+ for (FSEntrySequence::ConstIterator d(params.extra_repository_dirs()->begin()), d_end(params.extra_repository_dirs()->end()) ;
d != d_end ; ++d)
{
- if (params.repository_dir.realpath() == d->realpath())
+ if (params.repository_dir().realpath() == d->realpath())
{
Log::get_instance()->message("no_config_environment.extra_repository.ignoring", ll_warning, lc_context)
<< "Ignoring extra_repository_dir '" << *d << "' because it is the same as repository_dir";
@@ -183,57 +182,57 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- if (params.extra_params)
- std::copy(params.extra_params->begin(), params.extra_params->end(), keys->inserter());
+ if (params.extra_params())
+ std::copy(params.extra_params()->begin(), params.extra_params()->end(), keys->inserter());
keys->insert("format", "ebuild");
keys->insert("location", stringify(*d));
keys->insert("profiles", "/var/empty");
keys->insert("ignore_deprecated_profiles", "true");
- keys->insert("write_cache", stringify(params.write_cache));
+ keys->insert("write_cache", stringify(params.write_cache()));
keys->insert("names_cache", "/var/empty");
keys->insert("builddir", "/var/empty");
- if (params.disable_metadata_cache)
+ if (params.disable_metadata_cache())
keys->insert("cache", "/var/empty");
std::tr1::shared_ptr<Repository> repo(RepositoryFactory::get_instance()->create(
env, std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- if (stringify(repo->name()) == params.master_repository_name)
+ if (stringify(repo->name()) == params.master_repository_name())
master_repo = repo;
package_database->add_repository(1, repo);
}
- if ((! params.master_repository_name.empty()) && (! master_repo) && (! ignored_one))
- throw ConfigurationError("Can't find repository '" + params.master_repository_name + "'");
+ if ((! params.master_repository_name().empty()) && (! master_repo) && (! ignored_one))
+ throw ConfigurationError("Can't find repository '" + params.master_repository_name() + "'");
std::tr1::shared_ptr<Map<std::string, std::string> > keys( new Map<std::string, std::string>);
- if (params.extra_params)
- std::copy(params.extra_params->begin(), params.extra_params->end(), keys->inserter());
+ if (params.extra_params())
+ std::copy(params.extra_params()->begin(), params.extra_params()->end(), keys->inserter());
keys->insert("format", "ebuild");
- keys->insert("location", stringify(params.repository_dir));
+ keys->insert("location", stringify(params.repository_dir()));
keys->insert("profiles", "/var/empty");
keys->insert("ignore_deprecated_profiles", "true");
- keys->insert("write_cache", stringify(params.write_cache));
+ keys->insert("write_cache", stringify(params.write_cache()));
keys->insert("names_cache", "/var/empty");
keys->insert("builddir", "/var/empty");
- if (params.disable_metadata_cache)
+ if (params.disable_metadata_cache())
keys->insert("cache", "/var/empty");
if (master_repo)
- keys->insert("master_repository", params.master_repository_name);
+ keys->insert("master_repository", params.master_repository_name());
- if ((params.repository_dir / "metadata" / "profiles_desc.conf").exists())
+ if ((params.repository_dir() / "metadata" / "profiles_desc.conf").exists())
keys->insert("layout", "exheres");
package_database->add_repository(2, ((main_repo =
RepositoryFactory::get_instance()->create(env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)))));
- if ((! params.master_repository_name.empty()) && (! master_repo) && (params.master_repository_name != stringify(main_repo->name())))
- throw ConfigurationError("Can't find repository '" + params.master_repository_name + "'");
+ if ((! params.master_repository_name().empty()) && (! master_repo) && (params.master_repository_name() != stringify(main_repo->name())))
+ throw ConfigurationError("Can't find repository '" + params.master_repository_name() + "'");
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::tr1::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
@@ -248,8 +247,8 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context) << "VDB, using vdb_db";
std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- if (params.extra_params)
- std::copy(params.extra_params->begin(), params.extra_params->end(), keys->inserter());
+ if (params.extra_params())
+ std::copy(params.extra_params()->begin(), params.extra_params()->end(), keys->inserter());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
@@ -379,7 +378,7 @@ NoConfigEnvironment::accept_keywords(const std::tr1::shared_ptr<const KeywordNam
if (arch_var.empty())
{
- if (_imp->params.extra_accept_keywords.empty())
+ if (_imp->params.extra_accept_keywords().empty())
throw ConfigurationError("Don't know how to work out whether keywords are acceptable");
}
else
@@ -412,7 +411,7 @@ NoConfigEnvironment::accept_keywords(const std::tr1::shared_ptr<const KeywordNam
{
std::list<KeywordName> accepted;
- tokenise_whitespace(_imp->params.extra_accept_keywords,
+ tokenise_whitespace(_imp->params.extra_accept_keywords(),
create_inserter<KeywordName>(std::back_inserter(accepted)));
for (KeywordNameSet::ConstIterator k(keywords->begin()), k_end(keywords->end()) ;
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 72b3ce6..eb78bb4 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -28,10 +28,42 @@
namespace paludis
{
+ namespace n
+ {
+ struct accept_unstable;
+ struct disable_metadata_cache;
+ struct extra_accept_keywords;
+ struct extra_params;
+ struct extra_repository_dirs;
+ struct master_repository_name;
+ struct repository_dir;
+ struct repository_type;
+ struct write_cache;
+ }
+
namespace no_config_environment
{
#include <paludis/environments/no_config/no_config_environment-se.hh>
-#include <paludis/environments/no_config/no_config_environment-sr.hh>
+
+ /**
+ * Parameters for a NoConfigEnvironment.
+ *
+ * \see NoConfigEnvironment
+ * \ingroup grpnoconfigenvironment
+ * \nosubgrouping
+ */
+ struct Params
+ {
+ NamedValue<n::accept_unstable, bool> accept_unstable;
+ NamedValue<n::disable_metadata_cache, bool> disable_metadata_cache;
+ NamedValue<n::extra_accept_keywords, std::string> extra_accept_keywords;
+ NamedValue<n::extra_params, std::tr1::shared_ptr<Map<std::string, std::string> > > extra_params;
+ NamedValue<n::extra_repository_dirs, std::tr1::shared_ptr<const FSEntrySequence> > extra_repository_dirs;
+ NamedValue<n::master_repository_name, std::string> master_repository_name;
+ NamedValue<n::repository_dir, FSEntry> repository_dir;
+ NamedValue<n::repository_type, no_config_environment::RepositoryType> repository_type;
+ NamedValue<n::write_cache, FSEntry> write_cache;
+ };
}
/**
diff --git a/paludis/environments/no_config/no_config_environment.sr b/paludis/environments/no_config/no_config_environment.sr
deleted file mode 100644
index 703a68e..0000000
--- a/paludis/environments/no_config/no_config_environment.sr
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et :
-
-make_class_Params()
-{
- visible
-
- key repository_dir "FSEntry"
- key write_cache "FSEntry"
- key disable_metadata_cache bool
- key accept_unstable bool
- key extra_accept_keywords std::string
- key repository_type no_config_environment::RepositoryType
- key master_repository_name std::string
- key extra_repository_dirs "std::tr1::shared_ptr<const FSEntrySequence>"
- key extra_params "std::tr1::shared_ptr<Map<std::string, std::string> >"
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * Parameters for a NoConfigEnvironment.
- *
- * \see NoConfigEnvironment
- * \ingroup grpnoconfigenvironment
- * \nosubgrouping
- */
-END
-}
-
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index ff34331..50b621f 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -23,6 +23,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
using namespace test;
using namespace paludis;
@@ -35,16 +36,17 @@ namespace test_cases
void run()
{
- NoConfigEnvironment e(no_config_environment::Params::create()
- .repository_dir(FSEntry("no_config_environment_TEST_dir/repo"))
- .write_cache(FSEntry("/var/empty"))
- .accept_unstable(false)
- .repository_type(no_config_environment::ncer_auto)
- .disable_metadata_cache(false)
- .extra_params(std::tr1::shared_ptr<Map<std::string, std::string> >())
- .extra_accept_keywords("")
- .master_repository_name("")
- .extra_repository_dirs(make_shared_ptr(new FSEntrySequence)));
+ NoConfigEnvironment e(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(false),
+ value_for<n::disable_metadata_cache>(false),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(std::tr1::shared_ptr<Map<std::string, std::string> >()),
+ value_for<n::extra_repository_dirs>(make_shared_ptr(new FSEntrySequence)),
+ value_for<n::master_repository_name>(""),
+ value_for<n::repository_dir>(FSEntry("no_config_environment_TEST_dir/repo")),
+ value_for<n::repository_type>(no_config_environment::ncer_auto),
+ value_for<n::write_cache>(FSEntry("/var/empty"))
+ ));
TEST_CHECK(e.package_database());
}
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
index 0ffa69e..13aefa5 100644
--- a/paludis/environments/no_config/registration.cc
+++ b/paludis/environments/no_config/registration.cc
@@ -25,6 +25,7 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/make_named_values.hh>
#include <list>
using namespace paludis;
@@ -84,17 +85,17 @@ namespace
}
return std::tr1::shared_ptr<Environment>(new NoConfigEnvironment(
- no_config_environment::Params::create()
- .repository_dir(repository_dir)
- .write_cache(write_cache)
- .master_repository_name(master_repository_name)
- .extra_repository_dirs(extra_repository_dirs)
- .extra_params(extra_params)
- .repository_type(repository_type)
- .disable_metadata_cache(disable_metadata_cache)
- .accept_unstable(accept_unstable)
- .extra_accept_keywords(extra_accept_keywords)
- ));
+ make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(accept_unstable),
+ value_for<n::disable_metadata_cache>(disable_metadata_cache),
+ value_for<n::extra_accept_keywords>(extra_accept_keywords),
+ value_for<n::extra_params>(extra_params),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(master_repository_name),
+ value_for<n::repository_dir>(repository_dir),
+ value_for<n::repository_type>(repository_type),
+ value_for<n::write_cache>(write_cache)
+ )));
}
}
diff --git a/python/environment.cc b/python/environment.cc
index fbf052d..b2e5113 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -434,11 +434,17 @@ struct NoConfigEnvironmentWrapper :
NoConfigEnvironmentWrapper(const FSEntry & env_dir, const FSEntry & cache_dir,
const std::string & master_repo_name, const std::tr1::shared_ptr<const FSEntrySequence> & extra_repository_dirs
) :
- NoConfigEnvironment(no_config_environment::Params(env_dir, cache_dir, false, false, "",
- no_config_environment::ncer_auto, master_repo_name,
- extra_repository_dirs,
- std::tr1::shared_ptr<Map<std::string, std::string> >())
- )
+ NoConfigEnvironment(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(false),
+ value_for<n::disable_metadata_cache>(false),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(make_null_shared_ptr()),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(master_repo_name),
+ value_for<n::repository_dir>(env_dir),
+ value_for<n::repository_type>(no_config_environment::ncer_auto),
+ value_for<n::write_cache>(cache_dir)
+ ))
{
}
};
diff --git a/ruby/environment.cc b/ruby/environment.cc
index d4244e1..07c867a 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -25,6 +25,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/make_named_values.hh>
#include <ruby.h>
using namespace paludis;
@@ -352,16 +353,17 @@ namespace
path = StringValuePtr(argv[0]);
std::tr1::shared_ptr<Environment> * e = new std::tr1::shared_ptr<Environment>(new
- NoConfigEnvironment(no_config_environment::Params::create()
- .repository_dir(FSEntry(path))
- .write_cache(write_cache)
- .accept_unstable(false)
- .disable_metadata_cache(false)
- .repository_type(no_config_environment::ncer_auto)
- .extra_params(std::tr1::shared_ptr<Map<std::string, std::string> >())
- .extra_repository_dirs(extra_repository_dirs)
- .extra_accept_keywords("")
- .master_repository_name(master_repository_name)));
+ NoConfigEnvironment(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(false),
+ value_for<n::disable_metadata_cache>(false),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(std::tr1::shared_ptr<Map<std::string, std::string> >()),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(master_repository_name),
+ value_for<n::repository_dir>(FSEntry(path)),
+ value_for<n::repository_type>(no_config_environment::ncer_auto),
+ value_for<n::write_cache>(write_cache)
+ )));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<Environment> >::free, e));
rb_obj_call_init(tdata, argc, argv);
return tdata;
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 38755b6..e372fed 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -108,16 +108,17 @@ main(int argc, char *argv[])
std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
keys->insert("distdir", CommandLine::get_instance()->a_download_directory.argument());
- NoConfigEnvironment env(no_config_environment::Params::create()
- .repository_dir(CommandLine::get_instance()->a_repository_directory.argument())
- .write_cache(CommandLine::get_instance()->a_write_cache_dir.argument())
- .accept_unstable(true)
- .repository_type(no_config_environment::ncer_ebuild)
- .disable_metadata_cache(false)
- .extra_params(keys)
- .extra_accept_keywords("")
- .extra_repository_dirs(extra_repository_dirs)
- .master_repository_name(CommandLine::get_instance()->a_master_repository_name.argument()));
+ NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(true),
+ value_for<n::disable_metadata_cache>(false),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(keys),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(CommandLine::get_instance()->a_master_repository_name.argument()),
+ value_for<n::repository_dir>(CommandLine::get_instance()->a_repository_directory.argument()),
+ value_for<n::repository_type>(no_config_environment::ncer_ebuild),
+ value_for<n::write_cache>(CommandLine::get_instance()->a_write_cache_dir.argument())
+ ));
std::tr1::shared_ptr<const PackageIDSequence> ids(env[selection::AllVersionsSorted(
generator::InRepository(env.main_repository()->name()))]);
diff --git a/src/clients/adjutrix/adjutrix.cc b/src/clients/adjutrix/adjutrix.cc
index a00a945..bc7391a 100644
--- a/src/clients/adjutrix/adjutrix.cc
+++ b/src/clients/adjutrix/adjutrix.cc
@@ -34,6 +34,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <iostream>
#include <cstdlib>
@@ -134,18 +135,18 @@ main(int argc, char *argv[])
d != d_end ; ++d)
extra_repository_dirs->push_back(*d);
- NoConfigEnvironment env(no_config_environment::Params::create()
- .repository_dir(get_location_and_add_filters())
- .write_cache(CommandLine::get_instance()->a_write_cache_dir.argument())
- .accept_unstable(CommandLine::get_instance()->a_unstable.specified())
- .repository_type(
- (CommandLine::get_instance()->a_reverse_deps.specified()) ? no_config_environment::ncer_auto :
- no_config_environment::ncer_ebuild)
- .disable_metadata_cache(false)
- .master_repository_name(CommandLine::get_instance()->a_master_repository_name.argument())
- .extra_accept_keywords("")
- .extra_repository_dirs(extra_repository_dirs)
- .extra_params(std::tr1::shared_ptr<Map<std::string, std::string> >()));
+ NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(CommandLine::get_instance()->a_unstable.specified()),
+ value_for<n::disable_metadata_cache>(false),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(std::tr1::shared_ptr<Map<std::string, std::string> >()),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(CommandLine::get_instance()->a_master_repository_name.argument()),
+ value_for<n::repository_dir>(get_location_and_add_filters()),
+ value_for<n::repository_type>((CommandLine::get_instance()->a_reverse_deps.specified()) ?
+ no_config_environment::ncer_auto : no_config_environment::ncer_ebuild),
+ value_for<n::write_cache>(CommandLine::get_instance()->a_write_cache_dir.argument())
+ ));
if (CommandLine::get_instance()->a_find_stable_candidates.specified())
{
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 8ec79eb..0cd7b6a 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -36,6 +36,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
@@ -228,16 +229,17 @@ main(int argc, char *argv[])
std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
keys->insert("append_repository_name_to_write_cache", "false");
- NoConfigEnvironment env(no_config_environment::Params::create()
- .repository_dir(CommandLine::get_instance()->a_repository_directory.argument())
- .write_cache(CommandLine::get_instance()->a_output_directory.argument())
- .accept_unstable(true)
- .repository_type(no_config_environment::ncer_ebuild)
- .disable_metadata_cache(true)
- .extra_params(keys)
- .extra_accept_keywords("")
- .extra_repository_dirs(extra_repository_dirs)
- .master_repository_name(CommandLine::get_instance()->a_master_repository_name.argument()));
+ NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(true),
+ value_for<n::disable_metadata_cache>(true),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(keys),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(CommandLine::get_instance()->a_master_repository_name.argument()),
+ value_for<n::repository_dir>(CommandLine::get_instance()->a_repository_directory.argument()),
+ value_for<n::repository_type>(no_config_environment::ncer_ebuild),
+ value_for<n::write_cache>(CommandLine::get_instance()->a_output_directory.argument())
+ ));
std::tr1::shared_ptr<const PackageIDSequence> ids(env[selection::AllVersionsSorted(
generator::InRepository(env.main_repository()->name()))]);
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 1fd2071..c1441c5 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -336,17 +336,17 @@ int main(int argc, char *argv[])
d != d_end ; ++d)
extra_repository_dirs->push_back(*d);
- std::tr1::shared_ptr<NoConfigEnvironment> env(new NoConfigEnvironment(no_config_environment::Params::create()
- .repository_dir(get_location())
- .write_cache(QualudisCommandLine::get_instance()->a_write_cache_dir.argument())
- .accept_unstable(false)
- .repository_type(no_config_environment::ncer_ebuild)
- .extra_repository_dirs(extra_repository_dirs)
- .master_repository_name(QualudisCommandLine::get_instance()->a_master_repository_name.argument())
- .disable_metadata_cache(! QualudisCommandLine::get_instance()->a_use_repository_cache.specified())
- .extra_params(std::tr1::shared_ptr<Map<std::string, std::string> >())
- .extra_accept_keywords("")
- ));
+ std::tr1::shared_ptr<NoConfigEnvironment> env(new NoConfigEnvironment(make_named_values<no_config_environment::Params>(
+ value_for<n::accept_unstable>(false),
+ value_for<n::disable_metadata_cache>(! QualudisCommandLine::get_instance()->a_use_repository_cache.specified()),
+ value_for<n::extra_accept_keywords>(""),
+ value_for<n::extra_params>(std::tr1::shared_ptr<Map<std::string, std::string> >()),
+ value_for<n::extra_repository_dirs>(extra_repository_dirs),
+ value_for<n::master_repository_name>(QualudisCommandLine::get_instance()->a_master_repository_name.argument()),
+ value_for<n::repository_dir>(get_location()),
+ value_for<n::repository_type>(no_config_environment::ncer_ebuild),
+ value_for<n::write_cache>(QualudisCommandLine::get_instance()->a_write_cache_dir.argument())
+ )));
if (! (*env->main_repository()).qa_interface())
throw ConfigurationError("Repository '" + stringify(env->main_repository()->name()) + "' does not support QA checks");