aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-16 19:45:19 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-16 19:45:19 +0100
commit25c5dc5fa3b3e4c9285215b4791d2b2ba50070bc (patch)
treed64b27df88f98decf2b9ce4acb01f0eff2dc022f /paludis
parenta405f88556998958fb01f2eb5c202b8fccb84b59 (diff)
downloadpaludis-25c5dc5fa3b3e4c9285215b4791d2b2ba50070bc.tar.gz
paludis-25c5dc5fa3b3e4c9285215b4791d2b2ba50070bc.tar.xz
Kill NoConfigEnvironment with fire
Diffstat (limited to 'paludis')
-rw-r--r--paludis/Makefile.am.m41
-rw-r--r--paludis/environment_factory.cc1
-rw-r--r--paludis/environments/no_config/Makefile.am56
-rw-r--r--paludis/environments/no_config/no_config_environment.cc593
-rw-r--r--paludis/environments/no_config/no_config_environment.hh219
-rw-r--r--paludis/environments/no_config/no_config_environment.se23
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc44
-rwxr-xr-xpaludis/environments/no_config/no_config_environment_TEST_cleanup.sh9
-rwxr-xr-xpaludis/environments/no_config/no_config_environment_TEST_setup.sh25
-rw-r--r--paludis/environments/no_config/registration.cc123
10 files changed, 0 insertions, 1094 deletions
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index a95473950..1b9f5eb42 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -115,7 +115,6 @@ endif
')
condenv(dummy)
-condenv(no_config)
condenv(paludis)
condenv(portage)
condenv(test)
diff --git a/paludis/environment_factory.cc b/paludis/environment_factory.cc
index f03071f03..00b8fbd76 100644
--- a/paludis/environment_factory.cc
+++ b/paludis/environment_factory.cc
@@ -78,7 +78,6 @@ EnvironmentFactory::EnvironmentFactory() :
using namespace environment_groups;
register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_dummy>::Type *>(0), this);
- register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_no_config>::Type *>(0), this);
register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_paludis>::Type *>(0), this);
register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_portage>::Type *>(0), this);
register_environment(static_cast<const TypeOrNoType<ENVIRONMENT_GROUP_IF_test>::Type *>(0), this);
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am
deleted file mode 100644
index 4d8170a84..000000000
--- a/paludis/environments/no_config/Makefile.am
+++ /dev/null
@@ -1,56 +0,0 @@
-include $(top_srcdir)/misc/common-makefile.am
-
-DISTCLEANFILES = no_config_environment-se.hh no_config_environment-se.cc
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
-DEFS= \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLIBDIR=\"$(libdir)\"
-
-libpaludisnoconfigenvironment_la_SOURCES = \
- no_config_environment.cc no_config_environment.hh \
- registration.cc
-
-noinst_LTLIBRARIES = libpaludisnoconfigenvironment.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-se.hh
-
-EXTRA_DIST = \
- no_config_environment-se.hh \
- no_config_environment-se.cc \
- no_config_environment.se \
- no_config_environment_TEST.cc \
- no_config_environment_TEST_setup.sh \
- no_config_environment_TEST_cleanup.sh
-
-TESTS = no_config_environment_TEST
-
-check_PROGRAMS = $(TESTS)
-check_SCRIPTS = no_config_environment_TEST_setup.sh no_config_environment_TEST_cleanup.sh
-
-no_config_environment_TEST_SOURCES = no_config_environment_TEST.cc
-
-no_config_environment_TEST_LDADD = \
- $(top_builddir)/paludis/util/gtest_runner.o \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- $(DYNAMIC_LD_LIBS)
-
-no_config_environment_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
-
-no_config_environment_TEST_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @GTESTDEPS_CXXFLAGS@
-
-BUILT_SOURCES = \
- no_config_environment-se.hh \
- no_config_environment-se.cc
-
-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 > $@
-
-no_config_environment-se.cc : no_config_environment.se $(top_srcdir)/misc/make_se.bash
- $(top_srcdir)/misc/make_se.bash --source $(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
deleted file mode 100644
index e256f05ec..000000000
--- a/paludis/environments/no_config/no_config_environment.cc
+++ /dev/null
@@ -1,593 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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/environments/no_config/no_config_environment.hh>
-
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/map-impl.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/create_iterator-impl.hh>
-#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/config_file.hh>
-#include <paludis/util/wrapped_output_iterator-impl.hh>
-#include <paludis/util/tribool.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/graph-impl.hh>
-#include <paludis/util/hashes.hh>
-#include <paludis/util/member_iterator-impl.hh>
-#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/fs_path.hh>
-#include <paludis/util/fs_stat.hh>
-#include <paludis/util/fs_iterator.hh>
-#include <paludis/util/join.hh>
-
-#include <paludis/standard_output_manager.hh>
-#include <paludis/distribution.hh>
-#include <paludis/hook.hh>
-#include <paludis/literal_metadata_key.hh>
-#include <paludis/repository_factory.hh>
-#include <paludis/choice.hh>
-#include <paludis/repository.hh>
-
-#include <unordered_map>
-#include <functional>
-#include <algorithm>
-#include <set>
-#include <list>
-
-#include "config.h"
-
-using namespace paludis;
-using namespace paludis::no_config_environment;
-
-#include <paludis/environments/no_config/no_config_environment-se.cc>
-
-namespace paludis
-{
- template<>
- struct Imp<NoConfigEnvironment>
- {
- const no_config_environment::Params params;
-
- const FSPath top_level_dir;
- const FSPath write_cache;
- bool accept_unstable;
- bool is_vdb;
-
- std::shared_ptr<Repository> main_repo;
- std::shared_ptr<Repository> master_repo;
- std::list<std::shared_ptr<Repository> > extra_repos;
-
- std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
- std::shared_ptr<LiteralMetadataValueKey<FSPath> > repository_dir_key;
- std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
- std::shared_ptr<LiteralMetadataValueKey<FSPath> > system_root_key;
-
- Imp(const no_config_environment::Params & params);
- void initialise(NoConfigEnvironment * const env);
- };
-
- /* This goat is for Dave Wickham */
-}
-
-namespace
-{
- bool is_vdb_repository(const FSPath & location, no_config_environment::RepositoryType type)
- {
- switch (type)
- {
- case ncer_ebuild:
- return false;
- case ncer_vdb:
- return true;
- case ncer_auto:
- case last_ncer:
- ;
- }
-
- Context context("When determining repository type at '" + stringify(location) + "':");
-
- if (! location.stat().is_directory())
- throw ConfigurationError("Location is not a directory");
-
- if ((location / "profiles").stat().is_directory())
- {
- Log::get_instance()->message("no_config_environment.ebuild_detected", ll_debug, lc_context)
- << "Found profiles/, looks like Ebuild format";
- return false;
- }
-
- int outer_count(0);
- for (FSIterator d(location, { fsio_want_directories }), d_end ; d != d_end ; ++d)
- {
- int inner_count(0);
- for (FSIterator e(*d, { fsio_want_directories }), e_end ; e != e_end ; ++e)
- {
- if ((*e / "CONTENTS").stat().exists())
- {
- Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context)
- << "Found '" << stringify(*e) << "/CONTENTS', looks like VDB format";
- return true;
- }
-
- if (inner_count++ >= 5)
- break;
- }
-
- if (outer_count++ >= 5)
- break;
- }
-
- throw ConfigurationError("Can't work out what kind of repository this is");
- }
-
- std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
- const std::string & k)
- {
- Map<std::string, std::string>::ConstIterator mm(m->find(k));
- if (m->end() == mm)
- return "";
- else
- return mm->second;
- }
-}
-
-Imp<NoConfigEnvironment>::Imp(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())),
- format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "no_config")),
- repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("repository_dir", "Repository dir",
- mkt_normal, p.repository_dir())),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root",
- mkt_normal, FSPath("/"))),
- system_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("system_root", "System Root",
- mkt_normal, FSPath("/")))
-{
-}
-
-void
-Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
-{
- Context context("When initialising NoConfigEnvironment at '" + stringify(params.repository_dir()) + "':");
-
- if (! is_vdb)
- {
- /* don't assume these're in initialisable order. */
- std::map<FSPath, bool, FSPathComparator> repository_dirs;
- RepositoryName main_repository_name("x");
- bool ignored_one(false);
-
- repository_dirs.insert(std::make_pair(params.repository_dir(), true));
- for (FSPathSequence::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())
- {
- 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";
- ignored_one = true;
- continue;
- }
-
- repository_dirs.insert(std::make_pair(*d, false));
- }
-
- std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>,
- Hash<RepositoryName> > repo_configs;
-
- for (auto r(repository_dirs.begin()), r_end(repository_dirs.end()) ;
- r != r_end ; ++r)
- {
- Context local_context("When reading repository at location '" + stringify(r->first) + "':");
-
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
-
- if (params.extra_params())
- std::copy(params.extra_params()->begin(), params.extra_params()->end(), keys->inserter());
-
- keys->insert("format", "e");
- keys->insert("location", stringify(r->first.realpath()));
- keys->insert("profiles", params.profiles_if_not_auto().empty() ? "(auto)" : params.profiles_if_not_auto());
- keys->insert("ignore_deprecated_profiles", "true");
- keys->insert("write_cache", stringify(params.write_cache()));
- keys->insert("names_cache", "/var/empty");
- keys->insert("builddir", "/var/empty");
-
- if (params.disable_metadata_cache())
- keys->insert("cache", "/var/empty");
-
- if (r->second && ! params.master_repository_name().empty())
- keys->insert("master_repository", params.master_repository_name());
-
- if ((r->first / "metadata" / "profiles_desc.conf").stat().exists())
- keys->insert("layout", "exheres");
-
- std::function<std::string (const std::string &)> repo_func(
- std::bind(&from_keys, keys, std::placeholders::_1));
-
- RepositoryName name(RepositoryFactory::get_instance()->name(env, repo_func));
- if (ignored_one && r->second && stringify(name) == params.master_repository_name())
- keys->erase(std::string("master_repository"));
- if (! repo_configs.insert(std::make_pair(name, repo_func)).second)
- {
- Log::get_instance()->message("no_config_environment.repositories.duplicate", ll_warning, lc_context)
- << "Duplicate repository name '" << name << "' from path '" << r->first << "', skipping";
- continue;
- }
-
- if (r->second)
- main_repository_name = name;
- }
-
- /* work out order for repository creation */
- DirectedGraph<RepositoryName, bool> repository_deps;
- std::for_each(first_iterator(repo_configs.begin()), first_iterator(repo_configs.end()), std::bind(
- std::mem_fn(&DirectedGraph<RepositoryName, bool>::add_node),
- &repository_deps, std::placeholders::_1));
-
- for (std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>, Hash<RepositoryName> >::const_iterator
- r(repo_configs.begin()), r_end(repo_configs.end()) ; r != r_end ; ++r)
- {
- std::shared_ptr<const RepositoryNameSet> deps(RepositoryFactory::get_instance()->dependencies(
- env, r->second));
- for (RepositoryNameSet::ConstIterator d(deps->begin()), d_end(deps->end()) ;
- d != d_end ; ++d)
- {
- if (*d == r->first)
- {
- Log::get_instance()->message("no_config_environment.repositories.self_dependent", ll_warning, lc_context)
- << "Repository '" + stringify(r->first) + "' incorrectly requires itself";
- continue;
- }
-
- try
- {
- repository_deps.add_edge(r->first, *d, true);
- }
- catch (const NoSuchGraphNodeError &)
- {
- throw ConfigurationError("Repository '" + stringify(r->first) + "' requires repository '" +
- stringify(*d) + "', which is not configured");
- }
- }
- }
-
- try
- {
- std::list<RepositoryName> ordered_repos;
- repository_deps.topological_sort(std::back_inserter(ordered_repos));
-
- for (std::list<RepositoryName>::const_iterator o(ordered_repos.begin()), o_end(ordered_repos.end()) ;
- o != o_end ; ++o)
- {
- std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>, Hash<RepositoryName> >::const_iterator
- c(repo_configs.find(*o));
- if (c == repo_configs.end())
- throw InternalError(PALUDIS_HERE, "*o not in repo_configs");
-
- std::shared_ptr<Repository> repo(RepositoryFactory::get_instance()->create(env, c->second));
- if (repo->name() == main_repository_name)
- {
- main_repo = repo;
- env->add_repository(3, repo);
- }
- else if (stringify(repo->name()) == params.master_repository_name())
- {
- master_repo = repo;
- env->add_repository(2, repo);
- }
- else
- env->add_repository(1, repo);
- }
- }
- catch (const NoGraphTopologicalOrderExistsError & x)
- {
- throw ConfigurationError("Repositories have circular dependencies. Unresolvable repositories are '"
- + join(x.remaining_nodes()->begin(), x.remaining_nodes()->end(), "', '") + "'");
- }
-
- if (! main_repo)
- throw ConfigurationError("Don't have a main repository");
-
- 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() + "'");
- }
- else
- {
- Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context) << "VDB, using vdb_db";
-
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- 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");
- keys->insert("location", stringify(top_level_dir.realpath()));
-
- env->add_repository(1, RepositoryFactory::get_instance()->create(env,
- std::bind(from_keys, keys, std::placeholders::_1)));
- }
-}
-
-NoConfigEnvironment::NoConfigEnvironment(const no_config_environment::Params & params) :
- _imp(params)
-{
- _imp->initialise(this);
-
-#if 0
- if (_imp->main_repo)
- if ((*_imp->main_repo).e_interface()->end_profiles() != (*_imp->main_repo).e_interface()->begin_profiles())
- (*_imp->main_repo).e_interface()->set_profile((*_imp->main_repo).e_interface()->begin_profiles());
-
- if (_imp->master_repo)
- if ((*_imp->master_repo).e_interface()->end_profiles() !=
- (*_imp->master_repo).e_interface()->begin_profiles())
- (*_imp->master_repo).e_interface()->set_profile(
- (*_imp->master_repo).e_interface()->begin_profiles());
-#endif
-
- add_metadata_key(_imp->format_key);
- add_metadata_key(_imp->repository_dir_key);
- add_metadata_key(_imp->preferred_root_key);
- add_metadata_key(_imp->system_root_key);
-}
-
-NoConfigEnvironment::~NoConfigEnvironment()
-{
-}
-
-FSPath
-NoConfigEnvironment::main_repository_dir() const
-{
- return _imp->top_level_dir;
-}
-
-std::shared_ptr<Repository>
-NoConfigEnvironment::main_repository()
-{
- return _imp->main_repo;
-}
-
-std::shared_ptr<const Repository>
-NoConfigEnvironment::main_repository() const
-{
- return _imp->main_repo;
-}
-
-std::shared_ptr<Repository>
-NoConfigEnvironment::master_repository()
-{
- return _imp->master_repo;
-}
-
-std::shared_ptr<const Repository>
-NoConfigEnvironment::master_repository() const
-{
- return _imp->master_repo;
-}
-
-bool
-NoConfigEnvironment::accept_keywords(
- const std::shared_ptr<const KeywordNameSet> & keywords,
- const std::shared_ptr<const PackageID> &) const
-{
- if (_imp->is_vdb)
- return true;
-
- std::list<KeywordName> accepted;
- if (_imp->main_repo->accept_keywords_key())
- tokenise_whitespace(_imp->main_repo->accept_keywords_key()->parse_value(),
- create_inserter<KeywordName>(std::back_inserter(accepted)));
-
- tokenise_whitespace(_imp->params.extra_accept_keywords(),
- create_inserter<KeywordName>(std::back_inserter(accepted)));
-
- if (accepted.empty())
- throw ConfigurationError("Don't know how to work out whether keywords are acceptable");
-
- for (KeywordNameSet::ConstIterator k(keywords->begin()), k_end(keywords->end()) ;
- k != k_end ; ++k)
- {
- if (accepted.end() != std::find(accepted.begin(), accepted.end(), *k))
- return true;
-
- if (_imp->accept_unstable && stringify(*k).at(0) == '~')
- if (accepted.end() != std::find(accepted.begin(), accepted.end(), KeywordName(stringify(*k).substr(1))))
- return true;
- }
-
- return false;
-}
-
-bool
-NoConfigEnvironment::add_to_world(const QualifiedPackageName &) const
-{
- return false;
-}
-
-bool
-NoConfigEnvironment::remove_from_world(const QualifiedPackageName &) const
-{
- return false;
-}
-
-bool
-NoConfigEnvironment::add_to_world(const SetName &) const
-{
- return false;
-}
-
-bool
-NoConfigEnvironment::remove_from_world(const SetName &) const
-{
- return false;
-}
-
-bool
-NoConfigEnvironment::unmasked_by_user(const std::shared_ptr<const PackageID> &, const std::string &) const
-{
- return false;
-}
-
-const std::shared_ptr<const Mask>
-NoConfigEnvironment::mask_for_breakage(const std::shared_ptr<const PackageID> &) const
-{
- return std::shared_ptr<const Mask>();
-}
-
-const std::shared_ptr<const Mask>
-NoConfigEnvironment::mask_for_user(const std::shared_ptr<const PackageID> &, const bool) const
-{
- return std::shared_ptr<const Mask>();
-}
-
-uid_t
-NoConfigEnvironment::reduced_uid() const
-{
- return getuid();
-}
-
-gid_t
-NoConfigEnvironment::reduced_gid() const
-{
- return getgid();
-}
-
-std::shared_ptr<const MirrorsSequence>
-NoConfigEnvironment::mirrors(const std::string &) const
-{
- return std::make_shared<MirrorsSequence>();
-}
-
-bool
-NoConfigEnvironment::accept_license(const std::string &, const std::shared_ptr<const PackageID> &) const
-{
- return true;
-}
-
-HookResult
-NoConfigEnvironment::perform_hook(
- const Hook &,
- const std::shared_ptr<OutputManager> &
- ) const
-{
- return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
-}
-
-std::shared_ptr<const FSPathSequence>
-NoConfigEnvironment::hook_dirs() const
-{
- return std::make_shared<FSPathSequence>();
-}
-
-void
-NoConfigEnvironment::need_keys_added() const
-{
-}
-
-const std::shared_ptr<const MetadataValueKey<std::string> >
-NoConfigEnvironment::format_key() const
-{
- return _imp->format_key;
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-NoConfigEnvironment::config_location_key() const
-{
- return std::shared_ptr<const MetadataValueKey<FSPath> >();
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-NoConfigEnvironment::preferred_root_key() const
-{
- return _imp->preferred_root_key;
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-NoConfigEnvironment::system_root_key() const
-{
- return _imp->system_root_key;
-}
-
-const Tribool
-NoConfigEnvironment::want_choice_enabled(
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const Choice> &,
- const UnprefixedChoiceName &
- ) const
-{
- return Tribool(indeterminate);
-}
-
-const std::string
-NoConfigEnvironment::value_for_choice_parameter(
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const Choice> &,
- const UnprefixedChoiceName &
- ) const
-{
- return "";
-}
-
-std::shared_ptr<const Set<UnprefixedChoiceName> >
-NoConfigEnvironment::known_choice_value_names(
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const Choice> &
- ) const
-{
- return std::make_shared<Set<UnprefixedChoiceName>>();
-}
-
-const std::shared_ptr<OutputManager>
-NoConfigEnvironment::create_output_manager(const CreateOutputManagerInfo &) const
-{
- return std::make_shared<StandardOutputManager>();
-}
-
-void
-NoConfigEnvironment::populate_sets() const
-{
-}
-
-const std::shared_ptr<Repository>
-NoConfigEnvironment::repository_from_new_config_file(const FSPath &)
-{
- throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for NoConfigEnvironment");
-}
-
-void
-NoConfigEnvironment::update_config_files_for_package_move(const PackageDepSpec &, const QualifiedPackageName &) const
-{
-}
-
-Tribool
-NoConfigEnvironment::interest_in_suggestion(
- const std::shared_ptr<const PackageID> &,
- const PackageDepSpec &) const
-{
- return indeterminate;
-}
-
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
deleted file mode 100644
index 60be54777..000000000
--- a/paludis/environments/no_config/no_config_environment.hh
+++ /dev/null
@@ -1,219 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH
-#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH 1
-
-#include <paludis/environment_implementation.hh>
-#include <paludis/util/pimp.hh>
-#include <paludis/util/map-fwd.hh>
-
-namespace paludis
-{
- namespace n
- {
- typedef Name<struct name_accept_unstable> accept_unstable;
- typedef Name<struct name_disable_metadata_cache> disable_metadata_cache;
- typedef Name<struct name_extra_accept_keywords> extra_accept_keywords;
- typedef Name<struct name_extra_params> extra_params;
- typedef Name<struct name_extra_repository_dirs> extra_repository_dirs;
- typedef Name<struct name_master_repository_name> master_repository_name;
- typedef Name<struct name_profiles_if_not_auto> profiles_if_not_auto;
- typedef Name<struct name_repository_dir> repository_dir;
- typedef Name<struct name_repository_type> repository_type;
- typedef Name<struct name_write_cache> write_cache;
- }
-
- namespace no_config_environment
- {
-#include <paludis/environments/no_config/no_config_environment-se.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::shared_ptr<Map<std::string, std::string> > > extra_params;
- NamedValue<n::extra_repository_dirs, std::shared_ptr<const FSPathSequence> > extra_repository_dirs;
- NamedValue<n::master_repository_name, std::string> master_repository_name;
-
- /**
- * The profiles to use.
- *
- * Leave empty for automatic selection (which may not always be possible).
- *
- * \since 0.44
- */
- NamedValue<n::profiles_if_not_auto, std::string> profiles_if_not_auto;
-
- NamedValue<n::repository_dir, FSPath> repository_dir;
- NamedValue<n::repository_type, no_config_environment::RepositoryType> repository_type;
- NamedValue<n::write_cache, FSPath> write_cache;
- };
- }
-
- /**
- * An environment that uses a single repository, with no user configuration.
- *
- * \ingroup grpnoconfigenvironment
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE NoConfigEnvironment :
- public EnvironmentImplementation
- {
- private:
- Pimp<NoConfigEnvironment> _imp;
-
- virtual void need_keys_added() const;
-
- protected:
- virtual void populate_sets() const;
-
- public:
- ///\name Basic operations
- ///\{
-
- NoConfigEnvironment(const no_config_environment::Params & params);
-
- virtual ~NoConfigEnvironment();
-
- ///\}
-
- ///\name NoConfigEnvironment-specific configuration options
- ///\{
-
- /**
- * What is our top level directory for our main repository?
- */
- FSPath main_repository_dir() const;
-
- ///\}
-
- ///\name NoConfigEnvironment-specific repository information
- ///\{
-
- /**
- * Fetch our 'main' repository.
- */
- std::shared_ptr<Repository> main_repository();
-
- /**
- * Fetch our 'main' repository.
- */
- std::shared_ptr<const Repository> main_repository() const;
-
- /**
- * Fetch our 'master' repository (may be zero).
- */
- std::shared_ptr<Repository> master_repository();
-
- /**
- * Fetch our 'master' repository (may be zero).
- */
- std::shared_ptr<const Repository> master_repository() const;
-
- ///\}
-
- virtual const Tribool want_choice_enabled(
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const Choice> &,
- const UnprefixedChoiceName &
- ) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::string value_for_choice_parameter(
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const Choice> &,
- const UnprefixedChoiceName &
- ) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const Set<UnprefixedChoiceName> > known_choice_value_names(
- const std::shared_ptr<const PackageID> &,
- const std::shared_ptr<const Choice> &
- ) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual Tribool interest_in_suggestion(
- const std::shared_ptr<const PackageID> & from_id,
- const PackageDepSpec & spec) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool accept_license(const std::string &, const std::shared_ptr<const PackageID> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool accept_keywords(const std::shared_ptr<const KeywordNameSet> &, const std::shared_ptr<const PackageID> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::shared_ptr<const Mask> mask_for_breakage(const std::shared_ptr<const PackageID> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::shared_ptr<const Mask> mask_for_user(const std::shared_ptr<const PackageID> &, const bool will_be_used_for_overridden) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool unmasked_by_user(const std::shared_ptr<const PackageID> &, const std::string &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual uid_t reduced_uid() const;
-
- virtual gid_t reduced_gid() const;
-
- virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual HookResult perform_hook(
- const Hook &,
- const std::shared_ptr<OutputManager> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool add_to_world(const QualifiedPackageName &) const;
-
- virtual bool add_to_world(const SetName &) const;
-
- virtual bool remove_from_world(const QualifiedPackageName &) const;
-
- virtual bool remove_from_world(const SetName &) const;
-
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > system_root_key() const;
-
- virtual const std::shared_ptr<OutputManager> create_output_manager(
- const CreateOutputManagerInfo &) const;
-
- virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
-
- virtual void update_config_files_for_package_move(
- const PackageDepSpec &, const QualifiedPackageName &) const;
- };
-}
-
-#endif
diff --git a/paludis/environments/no_config/no_config_environment.se b/paludis/environments/no_config/no_config_environment.se
deleted file mode 100644
index 32376de2d..000000000
--- a/paludis/environments/no_config/no_config_environment.se
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et ft=sh :
-
-make_enum_RepositoryType()
-{
- namespace no_config_environment
- want_destringify
- prefix ncer
-
- key ncer_ebuild "Ebuilds"
- key ncer_vdb "VDB"
- key ncer_auto "Automatic"
-
- doxygen_comment << "END"
- /**
- * Type of repository for NoConfigEnvironment.
- *
- * \see NoConfigEnvironment
- * \since 0.28
- */
-END
-}
-
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
deleted file mode 100644
index c4403df15..000000000
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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/environments/no_config/no_config_environment.hh>
-
-#include <paludis/util/sequence.hh>
-#include <paludis/util/make_named_values.hh>
-
-#include <gtest/gtest.h>
-
-using namespace paludis;
-
-TEST(NoConfigEnvironment, Construction)
-{
- NoConfigEnvironment e(make_named_values<no_config_environment::Params>(
- n::accept_unstable() = false,
- n::disable_metadata_cache() = false,
- n::extra_accept_keywords() = "",
- n::extra_params() = std::shared_ptr<Map<std::string, std::string> >(),
- n::extra_repository_dirs() = std::make_shared<FSPathSequence>(),
- n::master_repository_name() = "",
- n::profiles_if_not_auto() = "",
- n::repository_dir() = FSPath("no_config_environment_TEST_dir/repo"),
- n::repository_type() = no_config_environment::ncer_auto,
- n::write_cache() = FSPath("/var/empty")
- ));
-}
-
diff --git a/paludis/environments/no_config/no_config_environment_TEST_cleanup.sh b/paludis/environments/no_config/no_config_environment_TEST_cleanup.sh
deleted file mode 100755
index 1948f4236..000000000
--- a/paludis/environments/no_config/no_config_environment_TEST_cleanup.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-if [ -d no_config_environment_TEST_dir ] ; then
- rm -fr no_config_environment_TEST_dir
-else
- true
-fi
-
diff --git a/paludis/environments/no_config/no_config_environment_TEST_setup.sh b/paludis/environments/no_config/no_config_environment_TEST_setup.sh
deleted file mode 100755
index a4421aaa2..000000000
--- a/paludis/environments/no_config/no_config_environment_TEST_setup.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-mkdir no_config_environment_TEST_dir || exit 2
-cd no_config_environment_TEST_dir || exit 3
-
-mkdir -p repo/{profiles/profile,cat-one/pkg-one}
-cat <<END > repo/profiles/repo_name
-foo
-END
-cat <<END > repo/profiles/categories
-cat-one
-END
-cat <<END > repo/profiles/profiles.desc
-foo profile stable
-END
-cat <<END > repo/profiles/profile/make.defaults
-ARCH="foo"
-USE="moo"
-USE_EXPAND="EXP MORE_EXP THIRD_EXP"
-EXP="one"
-MORE_EXP="one"
-THIRD_EXP="one"
-END
-
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
deleted file mode 100644
index 0f6f74b25..000000000
--- a/paludis/environments/no_config/registration.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008, 2009, 2010 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/environments/no_config/no_config_environment.hh>
-#include <paludis/environment_factory.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/destringify.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/make_named_values.hh>
-#include <list>
-#include "config.h"
-
-using namespace paludis;
-
-namespace
-{
- std::shared_ptr<Environment>
- make_no_config_environment(const std::string & s)
- {
- Context context("When making NoConfigEnvironment using spec '" + s + "':");
-
- std::shared_ptr<Map<std::string, std::string> > extra_params(
- std::make_shared<Map<std::string, std::string>>());
- FSPath repository_dir(FSPath::cwd());
- std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
- FSPath write_cache("/var/empty");
- std::string profile;
- std::string master_repository_name;
- bool disable_metadata_cache(false);
- bool accept_unstable(false);
- no_config_environment::RepositoryType repository_type(no_config_environment::ncer_auto);
- std::string extra_accept_keywords;
-
- std::list<std::string> tokens;
- tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(s, ":", "", std::back_inserter(tokens));
- for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
- t != t_end ; ++t)
- {
- std::string::size_type p(t->find('='));
- if (std::string::npos == p)
- repository_dir = FSPath(*t);
- else
- {
- std::string key(t->substr(0, p)), value(t->substr(p + 1));
-
- if (key == "write-cache")
- write_cache = FSPath(value);
- else if (key == "master-repository-name")
- master_repository_name = value;
- else if (key == "master-repository-dir")
- throw ConfigurationError("NoConfigEnvironment key master-repository-dir is no longer "
- "supported, use master-repository-name and extra-repository-dir");
- else if (key == "extra-repository-dir")
- extra_repository_dirs->push_back(FSPath(value));
- else if (key == "profile")
- profile = value;
- else if (key == "repository-dir")
- repository_dir = FSPath(value);
- else if (key == "disable-metadata-cache")
- disable_metadata_cache = destringify<bool>(value);
- else if (key == "accept-unstable")
- accept_unstable = destringify<bool>(value);
- else if (key == "repository-type")
- repository_type = destringify<no_config_environment::RepositoryType>(value);
- else if (key == "extra-accept-keywords")
- extra_accept_keywords = value;
- else
- extra_params->insert(key, value);
- }
- }
-
- return std::make_shared<NoConfigEnvironment>(
- make_named_values<no_config_environment::Params>(
- n::accept_unstable() = accept_unstable,
- n::disable_metadata_cache() = disable_metadata_cache,
- n::extra_accept_keywords() = extra_accept_keywords,
- n::extra_params() = extra_params,
- n::extra_repository_dirs() = extra_repository_dirs,
- n::master_repository_name() = master_repository_name,
- n::profiles_if_not_auto() = profile,
- n::repository_dir() = repository_dir,
- n::repository_type() = repository_type,
- n::write_cache() = write_cache
- ));
- }
-}
-
-namespace paludis
-{
- namespace environment_groups
- {
- ENVIRONMENT_GROUPS_DECLS;
- }
-
- template <>
- void register_environment<environment_groups::no_config>(const environment_groups::no_config * const,
- EnvironmentFactory * const factory)
- {
- std::shared_ptr<Set<std::string> > no_config_formats(std::make_shared<Set<std::string>>());
- no_config_formats->insert("no_config");
- no_config_formats->insert("no-config");
- factory->add_environment_format(no_config_formats, &make_no_config_environment);
- }
-}
-