aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-06 14:08:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-06 18:35:00 +0000
commit40281ddc9fcadf6c196d435339c75934a3c876af (patch)
treec11f7407f653568c8fa0b8c7c917b27ea736ae4e
parenta360e94b28c1bbd9c3c0f3cf6046428fcdecba25 (diff)
downloadpaludis-40281ddc9fcadf6c196d435339c75934a3c876af.tar.gz
paludis-40281ddc9fcadf6c196d435339c75934a3c876af.tar.xz
Expose less about profiles
-rw-r--r--paludis/environments/no_config/no_config_environment.cc69
-rw-r--r--paludis/environments/no_config/no_config_environment.hh11
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc3
-rw-r--r--paludis/environments/no_config/registration.cc4
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc8
-rw-r--r--paludis/repositories/accounts/accounts_repository.hh1
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc7
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh1
-rw-r--r--paludis/repositories/cran/cran_repository.cc7
-rw-r--r--paludis/repositories/cran/cran_repository.hh1
-rw-r--r--paludis/repositories/e/e_repository.cc247
-rw-r--r--paludis/repositories/e/e_repository.hh24
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc64
-rw-r--r--paludis/repositories/e/e_repository_params.hh2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc7
-rw-r--r--paludis/repositories/e/exndbam_repository.hh1
-rw-r--r--paludis/repositories/e/vdb_repository.cc7
-rw-r--r--paludis/repositories/e/vdb_repository.hh1
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc7
-rw-r--r--paludis/repositories/fake/fake_installed_repository.hh1
-rw-r--r--paludis/repositories/fake/fake_repository.cc7
-rw-r--r--paludis/repositories/fake/fake_repository.hh1
-rw-r--r--paludis/repositories/gems/gems_repository.cc7
-rw-r--r--paludis/repositories/gems/gems_repository.hh1
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc7
-rw-r--r--paludis/repositories/gems/installed_gems_repository.hh1
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc7
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh1
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc7
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc8
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh1
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc8
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh1
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc7
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh1
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc6
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh1
-rw-r--r--paludis/repository-fwd.hh1
-rw-r--r--paludis/repository.cc5
-rw-r--r--paludis/repository.hh67
-rw-r--r--python/environment.cc1
-rw-r--r--python/repository.cc74
-rwxr-xr-xpython/repository_TEST.py21
-rw-r--r--ruby/environment.cc1
-rw-r--r--ruby/paludis_ruby.hh1
-rw-r--r--ruby/repository.cc197
-rw-r--r--ruby/repository_TEST.rb81
-rw-r--r--src/clients/accerso/accerso.cc1
-rw-r--r--src/clients/adjutrix/adjutrix.cc25
-rw-r--r--src/clients/adjutrix/command_line.hh4
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc51
-rw-r--r--src/clients/adjutrix/downgrade_check.cc80
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc3
-rw-r--r--src/clients/appareo/appareo.cc1
-rw-r--r--src/clients/instruo/instruo.cc1
56 files changed, 312 insertions, 849 deletions
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 551c0ea..2777832 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -209,7 +209,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
keys->insert("format", "ebuild");
keys->insert("location", stringify(r->first.realpath()));
- keys->insert("profiles", "/var/empty");
+ 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");
@@ -354,6 +354,7 @@ NoConfigEnvironment::NoConfigEnvironment(const no_config_environment::Params & p
{
_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());
@@ -363,6 +364,7 @@ NoConfigEnvironment::NoConfigEnvironment(const no_config_environment::Params & p
(*_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);
@@ -443,63 +445,26 @@ NoConfigEnvironment::accept_keywords(const std::tr1::shared_ptr<const KeywordNam
if (_imp->is_vdb)
return true;
- std::string accept_keywords_var((*_imp->main_repo).e_interface()->accept_keywords_variable());
- std::string ak;
- if (! accept_keywords_var.empty())
- ak = (*_imp->main_repo).e_interface()->profile_variable(accept_keywords_var);
-
- if (ak.empty())
- {
- std::string arch_var((*_imp->main_repo).e_interface()->arch_variable());
-
- if (arch_var.empty())
- {
- if (_imp->params.extra_accept_keywords().empty())
- throw ConfigurationError("Don't know how to work out whether keywords are acceptable");
- }
- else
- {
- std::string arch((*_imp->main_repo).e_interface()->profile_variable(arch_var));
-
- if (keywords->end() != keywords->find(KeywordName(arch)))
- return true;
-
- if (_imp->accept_unstable && keywords->end() != keywords->find(KeywordName("~" + arch)))
- return true;
- }
- }
- else
- {
- std::list<KeywordName> accepted;
- tokenise_whitespace(ak, create_inserter<KeywordName>(std::back_inserter(accepted)));
+ std::list<KeywordName> accepted;
+ if (_imp->main_repo->accept_keywords_key())
+ tokenise_whitespace(_imp->main_repo->accept_keywords_key()->value(),
+ create_inserter<KeywordName>(std::back_inserter(accepted)));
- 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;
+ tokenise_whitespace(_imp->params.extra_accept_keywords(),
+ create_inserter<KeywordName>(std::back_inserter(accepted)));
- if (_imp->accept_unstable && stringify(*k).at(0) == '~')
- if (accepted.end() != std::find(accepted.begin(), accepted.end(), KeywordName(stringify(*k).substr(1))))
- return true;
- }
- }
+ 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)
{
- std::list<KeywordName> accepted;
- tokenise_whitespace(_imp->params.extra_accept_keywords(),
- create_inserter<KeywordName>(std::back_inserter(accepted)));
+ if (accepted.end() != std::find(accepted.begin(), accepted.end(), *k))
+ return true;
- for (KeywordNameSet::ConstIterator k(keywords->begin()), k_end(keywords->end()) ;
- k != k_end ; ++k)
- {
- if (accepted.end() != std::find(accepted.begin(), accepted.end(), *k))
+ if (_imp->accept_unstable && stringify(*k).at(0) == '~')
+ if (accepted.end() != std::find(accepted.begin(), accepted.end(), KeywordName(stringify(*k).substr(1))))
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;
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 506f419..27823f0 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -35,6 +35,7 @@ namespace paludis
struct extra_params;
struct extra_repository_dirs;
struct master_repository_name;
+ struct profiles_if_not_auto;
struct repository_dir;
struct repository_type;
struct write_cache;
@@ -59,6 +60,16 @@ namespace paludis
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;
+
+ /**
+ * 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, 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_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index 50b621f..3e1671a 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 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
@@ -43,6 +43,7 @@ namespace test_cases
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::profiles_if_not_auto>(""),
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"))
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
index 41cf543..f4e316e 100644
--- a/paludis/environments/no_config/registration.cc
+++ b/paludis/environments/no_config/registration.cc
@@ -43,6 +43,7 @@ namespace
FSEntry repository_dir(FSEntry::cwd());
std::tr1::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
FSEntry write_cache("/var/empty");
+ std::string profile;
std::string master_repository_name;
bool disable_metadata_cache(false);
bool accept_unstable(false);
@@ -70,6 +71,8 @@ namespace
"supported, use master-repository-name and extra-repository-dir");
else if (key == "extra-repository-dir")
extra_repository_dirs->push_back(value);
+ else if (key == "profile")
+ profile = value;
else if (key == "repository-dir")
repository_dir = value;
else if (key == "disable-metadata-cache")
@@ -93,6 +96,7 @@ namespace
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::profiles_if_not_auto>(profile),
value_for<n::repository_dir>(repository_dir),
value_for<n::repository_type>(repository_type),
value_for<n::write_cache>(write_cache)
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 3155de5..57193b4 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -111,7 +111,6 @@ AccountsRepository::AccountsRepository(const AccountsRepositoryParams & p) :
p.name(),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -131,7 +130,6 @@ AccountsRepository::AccountsRepository(const InstalledAccountsRepositoryParams &
p.name(),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -467,5 +465,11 @@ AccountsRepository::sync(const std::tr1::shared_ptr<OutputManager> &) const
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+AccountsRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
template class PrivateImplementationPattern<AccountsRepository>;
diff --git a/paludis/repositories/accounts/accounts_repository.hh b/paludis/repositories/accounts/accounts_repository.hh
index 70e19f2..60a9c5a 100644
--- a/paludis/repositories/accounts/accounts_repository.hh
+++ b/paludis/repositories/accounts/accounts_repository.hh
@@ -112,6 +112,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 31efcb4..95de78b 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -164,7 +164,6 @@ CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryPa
RepositoryName("installed-cran"),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -607,3 +606,9 @@ CRANInstalledRepository::sync(const std::tr1::shared_ptr<OutputManager> &) const
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+CRANInstalledRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 4abc378..d7e025d 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -149,6 +149,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name Set methods
///\{
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index ce6985e..ab5a857 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -109,7 +109,6 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
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)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -549,3 +548,9 @@ CRANRepository::perform_hook(const Hook &)
return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+CRANRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 75dd3d7..093a9b5 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -154,6 +154,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name Set methods
///\{
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index b278d30..80133d5 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -113,7 +113,7 @@ typedef std::tr1::unordered_map<QualifiedPackageName,
Hash<QualifiedPackageName> > RepositoryMaskMap;
typedef std::tr1::unordered_multimap<std::string, std::string, Hash<std::string> > MirrorMap;
typedef std::tr1::unordered_map<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec>, Hash<QualifiedPackageName> > VirtualsMap;
-typedef std::list<RepositoryEInterface::ProfilesDescLine> ProfilesDesc;
+
typedef std::map<FSEntry, std::string> EAPIForFileMap;
namespace
@@ -166,7 +166,6 @@ namespace paludis
Mutex repo_mask_mutex;
Mutex arch_flags_mutex;
Mutex mirrors_mutex;
- Mutex profiles_desc_mutex;
Mutex use_desc_mutex;
Mutex profile_ptr_mutex;
Mutex news_ptr_mutex;
@@ -191,16 +190,14 @@ namespace paludis
mutable bool has_mirrors;
mutable MirrorMap mirrors;
- mutable bool has_profiles_desc;
- mutable ProfilesDesc profiles_desc;
-
mutable std::tr1::shared_ptr<ERepositoryProfile> profile_ptr;
+ mutable std::tr1::shared_ptr<const FSEntry> main_profile_path;
mutable std::tr1::shared_ptr<ERepositoryNews> news_ptr;
mutable std::tr1::shared_ptr<ERepositorySets> sets_ptr;
mutable std::tr1::shared_ptr<ERepositoryEntries> entries_ptr;
- mutable std::tr1::shared_ptr<Layout> layout;
+ const std::tr1::shared_ptr<Layout> layout;
mutable EAPIForFileMap eapi_for_file_map;
@@ -208,7 +205,6 @@ namespace paludis
~Implementation();
void need_profiles() const;
- void need_profiles_desc() const;
std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
std::tr1::shared_ptr<const MetadataValueKey<std::string> > layout_key;
@@ -239,6 +235,7 @@ namespace paludis
std::tr1::shared_ptr<const MetadataValueKey<std::string> > binary_keywords;
std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > accounts_repository_data_location_key;
std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > e_updates_location_key;
+ std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key;
std::list<std::tr1::shared_ptr<const MetadataKey> > about_keys;
};
@@ -250,7 +247,6 @@ namespace paludis
names_cache(new RepositoryNameCache(p.names_cache(), r)),
has_repo_mask(false),
has_mirrors(false),
- has_profiles_desc(false),
sets_ptr(new ERepositorySets(params.environment(), r, p)),
entries_ptr(ERepositoryEntriesFactory::get_instance()->create(params.entry_format(), params.environment(), r, p)),
layout(LayoutFactory::get_instance()->create(params.layout(), r, params.location(), entries_ptr, get_master_locations(
@@ -361,82 +357,54 @@ namespace paludis
if (profile_ptr)
return;
- profile_ptr.reset(new ERepositoryProfile(
- params.environment(), repo, repo->name(), *params.profiles(),
- EAPIData::get_instance()->eapi_from_string(
- params.eapi_when_unknown())->supported()->ebuild_environment_variables()->env_arch(),
- params.profiles_explicitly_set()));
- }
+ std::tr1::shared_ptr<const FSEntrySequence> profiles(params.profiles());
- void
- Implementation<ERepository>::need_profiles_desc() const
- {
- if (has_profiles_desc)
- return;
-
- Lock l(mutexes->profiles_desc_mutex);
-
- if (has_profiles_desc)
- return;
-
- Context context("When loading profiles.desc:");
-
- bool found_one(false);
- std::tr1::shared_ptr<const FSEntrySequence> profiles_desc_files(layout->profiles_desc_files());
- for (FSEntrySequence::ConstIterator p(profiles_desc_files->begin()), p_end(profiles_desc_files->end()) ;
- p != p_end ; ++p)
+ if (params.auto_profiles())
{
- if (! p->exists())
- continue;
+ FSEntry profiles_desc("/dev/null");
+ for (FSEntrySequence::ConstIterator f(layout->profiles_desc_files()->begin()),
+ f_end(layout->profiles_desc_files()->end()) ;
+ f != f_end ; ++f)
+ if (f->is_regular_file_or_symlink_to_regular_file())
+ profiles_desc = *f;
- found_one = true;
+ std::tr1::shared_ptr<FSEntrySequence> auto_profiles(new FSEntrySequence);
- LineConfigFile f(*p, LineConfigFileOptions() + lcfo_disallow_continuations);
- for (LineConfigFile::ConstIterator line(f.begin()), line_end(f.end()) ; line != line_end ; ++line)
+ if (profiles_desc == FSEntry("/dev/null"))
{
- std::vector<std::string> tokens;
- tokenise_whitespace(*line, std::back_inserter(tokens));
- if (tokens.size() < 3)
- continue;
-
- std::tr1::shared_ptr<FSEntrySequence> profiles(new FSEntrySequence);
- profiles->push_back(layout->profiles_base_dir() / tokens.at(1));
- try
- {
- profiles_desc.push_back(make_named_values<RepositoryEInterface::ProfilesDescLine>(
- value_for<n::arch>(tokens.at(0)),
- value_for<n::path>(*profiles->begin()),
- value_for<n::profile>(make_shared_ptr(new RepositoryEInterfaceProfilesDescLineProfile(
- make_named_values<RepositoryEInterfaceProfilesDescLineProfile>(
- value_for<n::arch_var_if_special>(EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown())->supported()->ebuild_environment_variables()->env_arch()),
- value_for<n::environment>(params.environment()),
- value_for<n::location>(profiles),
- value_for<n::mutex>(make_shared_ptr(new Mutex)),
- value_for<n::profiles_explicitly_set>(true),
- value_for<n::repository>(repo),
- value_for<n::repository_name>(repo->name()),
- value_for<n::value>(make_null_shared_ptr())
- )))),
- value_for<n::status>(tokens.at(2))
- ));
- }
- catch (const InternalError &)
- {
- throw;
- }
- catch (const Exception & e)
+ auto_profiles->push_back(FSEntry("/var/empty"));
+ main_profile_path.reset(new FSEntry("/var/empty"));
+ }
+ else
+ {
+ Context context("When loading profiles.desc file '" + stringify(profiles_desc) + "':");
+ LineConfigFile f(profiles_desc, LineConfigFileOptions());
+ for (LineConfigFile::ConstIterator line(f.begin()), line_end(f.end()) ;
+ line != line_end ; ++line)
{
- Log::get_instance()->message("e.profile.failure", ll_warning, lc_context) << "Not loading profile '"
- << tokens.at(1) << "' due to exception '" << e.message() << "' (" << e.what() << ")";
+ std::vector<std::string> tokens;
+ tokenise_whitespace(*line, std::back_inserter(tokens));
+ if (tokens.size() < 3)
+ continue;
+
+ FSEntry p(params.location() / "profiles" / tokens.at(1));
+ auto_profiles->push_back(p);
+ main_profile_path.reset(new FSEntry(p));
+ break;
}
}
+ profiles = auto_profiles;
}
+ else if (params.profiles()->empty())
+ main_profile_path.reset(new FSEntry("/var/empty"));
+ else
+ main_profile_path.reset(new FSEntry(*params.profiles()->begin()));
- if (! found_one)
- throw ERepositoryConfigurationError("No profiles.desc found (maybe this repository is not synced, or maybe "
- "you need to specify its master");
-
- has_profiles_desc = true;
+ profile_ptr.reset(new ERepositoryProfile(
+ params.environment(), repo, repo->name(), *profiles,
+ EAPIData::get_instance()->eapi_from_string(
+ params.eapi_when_unknown())->supported()->ebuild_environment_variables()->env_arch(),
+ params.profiles_explicitly_set()));
}
}
@@ -494,7 +462,6 @@ ERepository::ERepository(const ERepositoryParams & p) :
fetch_repo_name(p.location()),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(p.binary_destination() ? this : 0),
- value_for<n::e_interface>(this),
value_for<n::environment_variable_interface>(this),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(this),
@@ -550,6 +517,8 @@ ERepository::_add_metadata_keys() const
add_metadata_key(_imp->accounts_repository_data_location_key);
if (_imp->e_updates_location_key)
add_metadata_key(_imp->e_updates_location_key);
+ if (_imp->accept_keywords_key)
+ add_metadata_key(_imp->accept_keywords_key);
std::for_each(_imp->about_keys.begin(), _imp->about_keys.end(), std::tr1::bind(
std::tr1::mem_fn(&ERepository::add_metadata_key), this, std::tr1::placeholders::_1));
@@ -959,72 +928,6 @@ ERepository::category_names_containing_package(const PackageNamePart & p) const
return result ? result : Repository::category_names_containing_package(p);
}
-ERepository::ProfilesConstIterator
-ERepository::begin_profiles() const
-{
- _imp->need_profiles_desc();
- return ProfilesConstIterator(_imp->profiles_desc.begin());
-}
-
-ERepository::ProfilesConstIterator
-ERepository::end_profiles() const
-{
- _imp->need_profiles_desc();
- return ProfilesConstIterator(_imp->profiles_desc.end());
-}
-
-ERepository::ProfilesConstIterator
-ERepository::find_profile(const FSEntry & location) const
-{
- _imp->need_profiles_desc();
- for (ProfilesDesc::const_iterator i(_imp->profiles_desc.begin()),
- i_end(_imp->profiles_desc.end()) ; i != i_end ; ++i)
- if ((*i).path() == location)
- return ProfilesConstIterator(i);
- return ProfilesConstIterator(_imp->profiles_desc.end());
-}
-
-void
-ERepository::set_profile(const ProfilesConstIterator & iter)
-{
- Context context("When setting profile by iterator:");
-
- Log::get_instance()->message("e.profile.using", ll_debug, lc_context)
- << "Using profile '" << ((*iter).path()) << "'";
-
- _imp->profile_ptr = (*iter).profile()->fetch();
-
- if ((*DistributionData::get_instance()->distribution_from_string(_imp->params.environment()->distribution()))
- .support_old_style_virtuals())
- if (_imp->params.environment()->package_database()->has_repository_named(RepositoryName("virtuals")))
- _imp->params.environment()->package_database()->fetch_repository(
- RepositoryName("virtuals"))->invalidate();
-
- invalidate_masks();
-}
-
-void
-ERepository::set_profile_by_arch(const std::string & arch)
-{
- Context context("When setting profile by arch '" + stringify(arch) + "':");
-
- for (ProfilesConstIterator p(begin_profiles()), p_end(end_profiles()) ; p != p_end ; ++p)
- if ((*p).arch() == stringify(arch) && (*p).status() == "stable")
- {
- set_profile(p);
- return;
- }
-
- for (ProfilesConstIterator p(begin_profiles()), p_end(end_profiles()) ; p != p_end ; ++p)
- if ((*p).arch() == stringify(arch))
- {
- set_profile(p);
- return;
- }
-
- throw ConfigurationError("Cannot find a profile appropriate for '" + stringify(arch) + "'");
-}
-
const ERepositoryParams &
ERepository::params() const
{
@@ -1208,25 +1111,36 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
}
}
-std::string
-ERepository::accept_keywords_variable() const
-{
- return EAPIData::get_instance()->eapi_from_string(
- eapi_for_file(*_imp->profiles_key->value()->begin())
- )->supported()->ebuild_environment_variables()->env_accept_keywords();
-}
-
-std::string
-ERepository::arch_variable() const
-{
- return EAPIData::get_instance()->eapi_from_string(
- eapi_for_file(*_imp->profiles_key->value()->begin())
- )->supported()->ebuild_environment_variables()->env_arch();
-}
-
void
ERepository::need_keys_added() const
{
+ Lock l(_imp->mutexes->profile_ptr_mutex);
+
+ if (! _imp->accept_keywords_key)
+ {
+ _imp->need_profiles();
+
+ std::string k, v;
+
+ v = EAPIData::get_instance()->eapi_from_string(eapi_for_file(*_imp->main_profile_path)
+ )->supported()->ebuild_environment_variables()->env_accept_keywords();
+ if (! v.empty())
+ k = _imp->profile_ptr->environment_variable(v);
+
+ if (k.empty())
+ {
+ v = EAPIData::get_instance()->eapi_from_string(eapi_for_file(*_imp->main_profile_path)
+ )->supported()->ebuild_environment_variables()->env_arch();
+ if (! v.empty())
+ k = _imp->profile_ptr->environment_variable(v);
+ }
+
+ _imp->accept_keywords_key.reset(new LiteralMetadataValueKey<std::string>(v,
+ "Default accepted keywords", mkt_internal, k));
+ add_metadata_key(_imp->accept_keywords_key);
+ }
+
+ return;
}
const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
@@ -1350,7 +1264,7 @@ ERepository::repository_factory_create(
}
std::tr1::shared_ptr<FSEntrySequence> profiles(new FSEntrySequence);
- bool profiles_explicitly_set(false);
+ bool profiles_explicitly_set(false), auto_profiles(false);
tokenise_whitespace(f("profiles"), create_inserter<FSEntry>(std::back_inserter(*profiles)));
if (profiles->empty())
{
@@ -1365,6 +1279,15 @@ ERepository::repository_factory_create(
throw ERepositoryConfigurationError("No profiles have been specified");
}
}
+ else if (f("profiles") == "(auto)")
+ {
+ profiles.reset(new FSEntrySequence);
+ if (master_repositories)
+ std::copy((*master_repositories->begin())->params().profiles()->begin(),
+ (*master_repositories->begin())->params().profiles()->end(), profiles->back_inserter());
+ else
+ auto_profiles = true;
+ }
else
profiles_explicitly_set = true;
@@ -1543,6 +1466,7 @@ ERepository::repository_factory_create(
return std::tr1::shared_ptr<ERepository>(new ERepository(make_named_values<ERepositoryParams>(
value_for<n::append_repository_name_to_write_cache>(append_repository_name_to_write_cache),
+ value_for<n::auto_profiles>(auto_profiles),
value_for<n::binary_destination>(binary_destination),
value_for<n::binary_distdir>(binary_distdir),
value_for<n::binary_keywords>(binary_keywords),
@@ -1696,3 +1620,10 @@ ERepository::populate_sets() const
}
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+ERepository::accept_keywords_key() const
+{
+ need_keys_added();
+ return _imp->accept_keywords_key;
+}
+
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 361d6f8..6f76fb5 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -55,7 +55,6 @@ namespace paludis
public RepositoryMirrorsInterface,
public RepositoryVirtualsInterface,
public RepositoryDestinationInterface,
- public RepositoryEInterface,
public RepositoryManifestInterface,
public std::tr1::enable_shared_from_this<ERepository>,
private PrivateImplementationPattern<ERepository>
@@ -150,29 +149,9 @@ namespace paludis
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
-
- ///\name Information about ERepository
- ///\{
-
- std::string profile_variable(const std::string &) const;
- virtual std::string accept_keywords_variable() const;
- virtual std::string arch_variable() const;
-
const erepository::ERepositoryParams & params() const;
- ///\}
-
- ///\name Profile setting and querying functions
- ///\{
-
- ProfilesConstIterator begin_profiles() const;
- ProfilesConstIterator end_profiles() const;
-
- ProfilesConstIterator find_profile(const FSEntry & location) const;
- void set_profile(const ProfilesConstIterator & iter);
- void set_profile_by_arch(const std::string &);
-
- ///\}
+ std::string profile_variable(const std::string &) const;
HookResult perform_hook(const Hook &)
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -198,6 +177,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
virtual const std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > info_vars_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 3a1c797..6412f04 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -770,39 +770,6 @@ namespace test_cases
}
} test_e_repository_query_profile_masks;
- struct ERepositoryInvalidateMasksTest : TestCase
- {
- ERepositoryInvalidateMasksTest() : TestCase("invalidate_masks") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- std::tr1::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
- std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
- env.package_database()->add_repository(1, repo);
-
- TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/was_masked-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->begin())->masked());
- repo->set_profile(repo->find_profile(repo->params().location() / "profiles/profile/subprofile"));
- TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/was_masked-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->begin())->masked());
- repo->set_profile(repo->find_profile(repo->params().location() / "profiles/profile"));
- TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/was_masked-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->begin())->masked());
- }
- } test_e_repository_invalidate_masks;
-
struct ERepositoryVirtualsTest : TestCase
{
ERepositoryVirtualsTest() : TestCase("virtuals") { }
@@ -822,7 +789,7 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
env.package_database()->add_repository(1, repo);
- bool has_one(false), has_two(false), has_three(false);
+ bool has_one(false), has_two(false);
int count(0);
std::tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> seq(repo->virtual_packages());
@@ -843,13 +810,32 @@ namespace test_cases
TEST_CHECK(has_one);
TEST_CHECK(has_two);
TEST_CHECK_EQUAL(count, 2);
+ }
+ } test_e_repository_virtuals;
- repo->set_profile(repo->find_profile(repo->params().location() / "profiles/profile/subprofile"));
+ struct ERepositoryVirtuals2Test : TestCase
+ {
+ ERepositoryVirtuals2Test() : TestCase("virtuals 2") { }
- has_one = has_two = false;
- count = 0;
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile/subprofile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
+ env.package_database()->add_repository(1, repo);
- seq = repo->virtual_packages();
+ bool has_one(false), has_two(false), has_three(false);
+ int count(0);
+
+ std::tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> seq(repo->virtual_packages());
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
it_end(seq->end()); it_end != it; ++it, ++count)
if ("virtual/one" == stringify(it->virtual_name()))
@@ -874,7 +860,7 @@ namespace test_cases
TEST_CHECK(has_three);
TEST_CHECK_EQUAL(count, 3);
}
- } test_e_repository_virtuals;
+ } test_e_repository_virtuals_2;
struct ERepositoryManifestTest : TestCase
{
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index 2980f0a..3dfd81f 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -40,6 +40,7 @@ namespace paludis
namespace n
{
struct append_repository_name_to_write_cache;
+ struct auto_profiles;
struct binary_destination;
struct binary_distdir;
struct binary_keywords;
@@ -77,6 +78,7 @@ namespace paludis
struct ERepositoryParams
{
NamedValue<n::append_repository_name_to_write_cache, bool> append_repository_name_to_write_cache;
+ NamedValue<n::auto_profiles, bool> auto_profiles;
NamedValue<n::binary_destination, bool> binary_destination;
NamedValue<n::binary_distdir, FSEntry> binary_distdir;
NamedValue<n::binary_keywords, std::string> binary_keywords;
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 4d72e93..97445df 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -104,7 +104,6 @@ ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepo
n,
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(this),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -606,3 +605,9 @@ ExndbamRepository::perform_updates()
{
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+ExndbamRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index 91377d6..8ca9587 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.hh
@@ -113,6 +113,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name For use by ExndbamID
///\{
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 4db8893..ff11d86 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -165,7 +165,6 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
p.name(),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(this),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -1560,3 +1559,9 @@ VDBRepository::perform_updates()
}
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+VDBRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index 3d39c0f..47f3326 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -161,6 +161,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 80afb5d..16b6e4b 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -59,7 +59,6 @@ namespace paludis
FakeInstalledRepository::FakeInstalledRepository(const FakeInstalledRepositoryParams & p) :
FakeRepositoryBase(p.environment(), p.name(), make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -241,3 +240,9 @@ FakeInstalledRepository::repository_factory_dependencies(
return make_shared_ptr(new RepositoryNameSet);
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+FakeInstalledRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/fake/fake_installed_repository.hh b/paludis/repositories/fake/fake_installed_repository.hh
index c61a0b8..fc36a3e 100644
--- a/paludis/repositories/fake/fake_installed_repository.hh
+++ b/paludis/repositories/fake/fake_installed_repository.hh
@@ -92,6 +92,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index d412c3a..fc38ae2 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -60,7 +60,6 @@ FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
FakeRepositoryBase(params.environment(), params.name(), make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -176,3 +175,9 @@ FakeRepository::installed_root_key() const
return std::tr1::shared_ptr<const MetadataValueKey<FSEntry> >();
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+FakeRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index 40c71d4..8bd44f3 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -94,6 +94,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
};
}
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 19fdb00..efc4b9f 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -93,7 +93,6 @@ GemsRepository::GemsRepository(const gems::RepositoryParams & params) :
Repository(params.environment(), RepositoryName("gems"),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -415,3 +414,9 @@ GemsRepository::sync(const std::tr1::shared_ptr<OutputManager> &) const
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+GemsRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh
index 1223fcb..e8e3f4f 100644
--- a/paludis/repositories/gems/gems_repository.hh
+++ b/paludis/repositories/gems/gems_repository.hh
@@ -91,6 +91,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index e76c48e..1066ac3 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -97,7 +97,6 @@ InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepository
RepositoryName("installed-gems"),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -459,3 +458,9 @@ InstalledGemsRepository::sync(const std::tr1::shared_ptr<OutputManager> &) const
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+InstalledGemsRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/gems/installed_gems_repository.hh b/paludis/repositories/gems/installed_gems_repository.hh
index 231e52a..a81a468 100644
--- a/paludis/repositories/gems/installed_gems_repository.hh
+++ b/paludis/repositories/gems/installed_gems_repository.hh
@@ -106,6 +106,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 6de05df..9bf12fe 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -87,7 +87,6 @@ UnavailableRepository::UnavailableRepository(const UnavailableRepositoryParams &
p.name(),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -348,5 +347,11 @@ UnavailableRepository::perform_hook(const Hook &)
return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+UnavailableRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
template class PrivateImplementationPattern<unavailable_repository::UnavailableRepository>;
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index aa7b480..f4247f1 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -76,6 +76,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual bool has_category_named(const CategoryNamePart & c) const;
virtual bool has_package_named(const QualifiedPackageName & q) const;
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 6f7397b..61e65bd 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -92,7 +92,6 @@ InstalledUnpackagedRepository::InstalledUnpackagedRepository(
PrivateImplementationPattern<InstalledUnpackagedRepository>(new Implementation<InstalledUnpackagedRepository>(p)),
Repository(p.environment(), n, make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(this),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -522,3 +521,9 @@ InstalledUnpackagedRepository::sync(const std::tr1::shared_ptr<OutputManager> &)
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+InstalledUnpackagedRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index e6b4380..1d98ad3 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -107,6 +107,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index d4a43d4..aa550ff 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -97,7 +97,6 @@ UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
PrivateImplementationPattern<UnpackagedRepository>(new Implementation<UnpackagedRepository>(n, params)),
Repository(params.environment(), n, make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -291,3 +290,10 @@ UnpackagedRepository::sync(const std::tr1::shared_ptr<OutputManager> &) const
{
return false;
}
+
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+UnpackagedRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index 4630668..0adfb8b 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -108,6 +108,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index dbb8a08..910f8f4 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -87,7 +87,6 @@ UnwrittenRepository::UnwrittenRepository(const UnwrittenRepositoryParams & p) :
p.name(),
make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -348,6 +347,11 @@ UnwrittenRepository::perform_hook(const Hook &)
return make_named_values<HookResult>(value_for<n::max_exit_status>(0), value_for<n::output>(""));
}
-template class PrivateImplementationPattern<unwritten_repository::UnwrittenRepository>;
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+UnwrittenRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+template class PrivateImplementationPattern<unwritten_repository::UnwrittenRepository>;
diff --git a/paludis/repositories/unwritten/unwritten_repository.hh b/paludis/repositories/unwritten/unwritten_repository.hh
index f6bae02..a152cd2 100644
--- a/paludis/repositories/unwritten/unwritten_repository.hh
+++ b/paludis/repositories/unwritten/unwritten_repository.hh
@@ -75,6 +75,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual bool has_category_named(const CategoryNamePart & c) const;
virtual bool has_package_named(const QualifiedPackageName & q) const;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 7af63a9..3ddba4f 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -111,7 +111,6 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
const FSEntry & r) :
Repository(env, RepositoryName(make_name(r)), make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(this)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -391,3 +390,9 @@ InstalledVirtualsRepository::sync(const std::tr1::shared_ptr<OutputManager> &) c
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+InstalledVirtualsRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
+
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 03ff4ad..c4dd561 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -113,6 +113,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
/* RepositoryDestinationInterface */
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index cc03643..49ef786 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -123,7 +123,6 @@ namespace
VirtualsRepository::VirtualsRepository(const Environment * const env) :
Repository(env, RepositoryName("virtuals"), make_named_values<RepositoryCapabilities>(
value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
- value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
value_for<n::make_virtuals_interface>(this),
value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
@@ -468,4 +467,9 @@ VirtualsRepository::sync(const std::tr1::shared_ptr<OutputManager> &) const
return false;
}
+const std::tr1::shared_ptr<const MetadataValueKey<std::string> >
+VirtualsRepository::accept_keywords_key() const
+{
+ return make_null_shared_ptr();
+}
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index fc460de..573dc98 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -116,6 +116,7 @@ namespace paludis
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
///\name Set methods
///\{
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index a89c25c..fdd101b 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -45,7 +45,6 @@ namespace paludis
class RepositoryVirtualsInterface;
class RepositoryMakeVirtualsInterface;
class RepositoryDestinationInterface;
- class RepositoryEInterface;
class RepositoryManifestInterface;
class RepositoryEInterfaceProfilesDescLine;
diff --git a/paludis/repository.cc b/paludis/repository.cc
index e555967..d14abb2 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -57,7 +57,6 @@ template class WrappedOutputIterator<Sequence<RepositoryProvidesEntry>::Inserter
template class WrappedForwardIterator<RepositoryMirrorsInterface::MirrorsConstIteratorTag,
const std::pair<const std::string, std::string> >;
-template class WrappedForwardIterator<RepositoryEInterface::ProfilesConstIteratorTag, const RepositoryEInterface::ProfilesDescLine>;
NoSuchSetError::NoSuchSetError(const std::string & our_name) throw () :
Exception("Could not find '" + our_name + "'"),
@@ -204,10 +203,6 @@ RepositoryDestinationInterface::~RepositoryDestinationInterface()
{
}
-RepositoryEInterface::~RepositoryEInterface()
-{
-}
-
RepositoryMakeVirtualsInterface::~RepositoryMakeVirtualsInterface()
{
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 4df7123..c61abc3 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -57,7 +57,6 @@ namespace paludis
{
struct arch;
struct destination_interface;
- struct e_interface;
struct environment_file;
struct environment_variable_interface;
struct image_dir;
@@ -90,7 +89,6 @@ namespace paludis
struct RepositoryCapabilities
{
NamedValue<n::destination_interface, RepositoryDestinationInterface *> destination_interface;
- NamedValue<n::e_interface, RepositoryEInterface *> e_interface;
NamedValue<n::environment_variable_interface, RepositoryEnvironmentVariableInterface *> environment_variable_interface;
NamedValue<n::make_virtuals_interface, RepositoryMakeVirtualsInterface *> make_virtuals_interface;
NamedValue<n::manifest_interface, RepositoryManifestInterface *> manifest_interface;
@@ -100,22 +98,6 @@ namespace paludis
};
/**
- * A profiles.desc line in a Repository implementing RepositoryEInterface.
- *
- * \see Repository
- * \see RepositoryEInterface
- * \ingroup g_repository
- * \since 0.30
- */
- struct RepositoryEInterfaceProfilesDescLine
- {
- NamedValue<n::arch, std::string> arch;
- NamedValue<n::path, FSEntry> path;
- NamedValue<n::profile, std::tr1::shared_ptr<const RepositoryEInterfaceProfilesDescLineProfile> > profile;
- NamedValue<n::status, std::string> status;
- };
-
- /**
* A provides entry in a Repository implementing RepositoryProvidesInterface.
*
* \see Repository
@@ -310,6 +292,17 @@ namespace paludis
*/
virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const = 0;
+ /**
+ * The accept_keywords_key belonging to a NoConfigEnvironment's
+ * main repository is used to work out whether to accept keywords.
+ *
+ * This only needs to be defined for repositories that can be a
+ * NoConfigEnvironment main repository.
+ *
+ * \since 0.44
+ */
+ virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const = 0;
+
///\}
///\name Repository content queries
@@ -608,44 +601,6 @@ namespace paludis
};
/**
- * Interface for handling ERepository specific functionality.
- *
- * \see Repository
- * \ingroup g_repository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE RepositoryEInterface
- {
- public:
- ///\name Information about a ERepository
- ///\{
-
- virtual std::string profile_variable(const std::string &) const = 0;
- virtual std::string accept_keywords_variable() const = 0;
- virtual std::string arch_variable() const = 0;
-
- ///\}
-
- ///\name Profile setting and querying functions
- ///\{
-
- typedef RepositoryEInterfaceProfilesDescLine ProfilesDescLine;
-
- struct ProfilesConstIteratorTag;
- typedef WrappedForwardIterator<ProfilesConstIteratorTag, const ProfilesDescLine> ProfilesConstIterator;
- virtual ProfilesConstIterator begin_profiles() const = 0;
- virtual ProfilesConstIterator end_profiles() const = 0;
-
- virtual ProfilesConstIterator find_profile(const FSEntry & location) const = 0;
- virtual void set_profile(const ProfilesConstIterator & iter) = 0;
- virtual void set_profile_by_arch(const std::string &) = 0;
-
- ///\}
-
- virtual ~RepositoryEInterface();
- };
-
- /**
* Interface for making and verifying Manifest2-style manifests
*
* \see Repository
diff --git a/python/environment.cc b/python/environment.cc
index 043bb39..403004e 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -452,6 +452,7 @@ struct NoConfigEnvironmentWrapper :
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::profiles_if_not_auto>(""),
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/python/repository.cc b/python/repository.cc
index d950aa8..661b238 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -69,12 +69,6 @@ struct RepositoryWrapper :
return self.destination_interface();
}
- static RepositoryEInterface *
- get_e_interface(const Repository & self)
- {
- return self.e_interface();
- }
-
static PyObject *
find_metadata(const Repository & self, const std::string & key)
{
@@ -95,24 +89,6 @@ struct FakeRepositoryWrapper
}
};
-struct RepositoryEInterfaceWrapper
-{
- static bp::object
- my_find_profile(const RepositoryEInterface & self, const FSEntry & location)
- {
- RepositoryEInterface::ProfilesConstIterator p(self.find_profile(location));
- if (p == self.end_profiles())
- return bp::object();
- return bp::object(bp::ptr(&*p));
- }
-
- static void
- my_set_profile(RepositoryEInterface & self, const RepositoryEInterface::ProfilesDescLine & pdl)
- {
- self.set_profile(self.find_profile(pdl.path()));
- }
-};
-
// FIXME
//template <typename I_>
//struct repository_interface_to_python
@@ -236,11 +212,6 @@ void expose_repository()
"[ro] RepositoryDestinationInterface"
)
- .add_property("e_interface", bp::make_function(&RepositoryWrapper::get_e_interface,
- bp::return_internal_reference<>()),
- "[ro] RepositoryEInterface"
- )
-
.def("format_key", &Repository::format_key,
"The format_key, if not None, holds our repository's format"
)
@@ -267,26 +238,6 @@ void expose_repository()
;
/**
- * RepositoryEInterfaceProfilesDescLine
- */
- bp::class_<RepositoryEInterfaceProfilesDescLine>
- (
- "RepositoryEInterfaceProfilesDescLine",
- "A profiles.desc line in a Repository implementing RepositoryEInterface.",
- bp::no_init
- )
- .add_property("path",
- &named_values_getter<RepositoryEInterfaceProfilesDescLine, n::path, FSEntry, &RepositoryEInterfaceProfilesDescLine::path>
- )
- .add_property("arch",
- &named_values_getter<RepositoryEInterfaceProfilesDescLine, n::arch, std::string, &RepositoryEInterfaceProfilesDescLine::arch>
- )
- .add_property("status",
- &named_values_getter<RepositoryEInterfaceProfilesDescLine, n::status, std::string, &RepositoryEInterfaceProfilesDescLine::status>
- )
- ;
-
- /**
* RepositoryEnvironmentVariableInterface
*/
bp::class_<RepositoryEnvironmentVariableInterface, boost::noncopyable>
@@ -337,31 +288,6 @@ void expose_repository()
);
/**
- * RepositoryEInterface
- */
- bp::class_<RepositoryEInterface, boost::noncopyable>
- (
- "RepositoryEInterface",
- "Interface for handling ERepository specific functionality.",
- bp::no_init
- )
- .add_property("profiles", bp::range(&RepositoryEInterface::begin_profiles,
- &RepositoryEInterface::end_profiles),
- "[ro] Iterable of Profiles"
- )
-
- .def("profile_variable", &RepositoryEInterface::profile_variable)
-
- .def("find_profile", &RepositoryEInterfaceWrapper::my_find_profile,
- "find_profile(path_string) -> RepositoryEInterfaceProfilesDescLine"
- )
-
- .add_property("profile", bp::object(), &RepositoryEInterfaceWrapper::my_set_profile,
- "[wo] RepositoryEInterfaceProfilesDescLine"
- )
- ;
-
- /**
* FakeRepository
*/
bp::implicitly_convertible<std::tr1::shared_ptr<FakeRepository>, std::tr1::shared_ptr<Repository> >();
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index b6eb208..52e44cf 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -127,27 +127,6 @@ class TestCase_02_RepositoryInterfaces(unittest.TestCase):
di = irepo.destination_interface
self.assert_(isinstance(di, RepositoryDestinationInterface))
- def test_12_e_interface(self):
- ei = nce.main_repository.e_interface
-
- self.assert_(isinstance(ei, RepositoryEInterface))
-
- path = os.path.join(os.getcwd(), "repository_TEST_dir/testrepo/profiles/testprofile")
- profile = ei.find_profile(path)
-
- self.assert_(isinstance(profile, RepositoryEInterfaceProfilesDescLine))
- self.assertEquals(profile.path, path)
- self.assertEquals(profile.arch, "x86")
- self.assertEquals(profile.status, "stable")
-
-
- self.assertEquals(ei.find_profile("broken"), None)
-
- profile = iter(ei.profiles).next()
- ei.profile = profile
-
- self.assertEquals(ei.profile_variable("ARCH"), "test")
-
def test_12_qa_interface(self):
if hasattr(paludis, "QAReporter"):
class PyQAR(QAReporter):
diff --git a/ruby/environment.cc b/ruby/environment.cc
index d3b5f6f..67de476 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -391,6 +391,7 @@ namespace
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::profiles_if_not_auto>(""),
value_for<n::repository_dir>(FSEntry(path)),
value_for<n::repository_type>(no_config_environment::ncer_auto),
value_for<n::write_cache>(write_cache)
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 93f6d21..40234e6 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -119,7 +119,6 @@ namespace paludis
QualifiedPackageName value_to_qualified_package_name(VALUE v);
std::tr1::shared_ptr<Environment> value_to_environment(VALUE v);
std::tr1::shared_ptr<NoConfigEnvironment> value_to_no_config_environment(VALUE v);
- RepositoryEInterface::ProfilesDescLine value_to_profiles_desc_line(VALUE v);
std::tr1::shared_ptr<Repository> value_to_repository(VALUE);
std::tr1::shared_ptr<const SupportsActionTestBase> value_to_supports_action_test_base(VALUE v);
std::tr1::shared_ptr<Action> value_to_action(VALUE v);
diff --git a/ruby/repository.cc b/ruby/repository.cc
index b27d7b9..1c26e16 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -43,18 +43,10 @@ using namespace paludis::ruby;
namespace
{
static VALUE c_repository;
- static VALUE c_profiles_desc_line;
static VALUE c_fake_repository_base;
static VALUE c_fake_repository;
static VALUE c_fake_installed_repository;
- VALUE
- profiles_desc_line_to_value(const RepositoryEInterface::ProfilesDescLine & v)
- {
- RepositoryEInterface::ProfilesDescLine * vv(new RepositoryEInterface::ProfilesDescLine(v));
- return Data_Wrap_Struct(c_profiles_desc_line, 0, &Common<RepositoryEInterface::ProfilesDescLine>::free, vv);
- }
-
std::tr1::shared_ptr<FakeRepositoryBase>
value_to_fake_repository_base(VALUE v)
{
@@ -395,158 +387,6 @@ namespace
/*
* call-seq:
- * profiles -> Array
- *
- * Fetch an array of our profiles, as ProfilesDescLine.
- */
- VALUE
- repository_profiles(VALUE self)
- {
- try
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if ((**self_ptr).e_interface())
- {
- VALUE result(rb_ary_new());
- for (RepositoryEInterface::ProfilesConstIterator i((**self_ptr).e_interface()->begin_profiles()),
- i_end((**self_ptr).e_interface()->end_profiles()) ; i != i_end ; ++i)
- {
- rb_ary_push(result, profiles_desc_line_to_value(*i));
- }
- return result;
- }
- else
- {
- return Qnil;
- }
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * find_profile(profile_location) -> ProfilesDescLine
- *
- * Fetches the named profile.
- */
- VALUE
- repository_find_profile(VALUE self, VALUE profile)
- {
- try
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
-
- if ((**self_ptr).e_interface())
- {
- RepositoryEInterface::ProfilesConstIterator p((**self_ptr).e_interface()->find_profile(FSEntry(StringValuePtr(profile))));
-
- if (p == (**self_ptr).e_interface()->end_profiles())
- return Qnil;
-
- return profiles_desc_line_to_value(*p);
- }
- else
- {
- return Qnil;
- }
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * set_profile(profile) -> Nil
- *
- * Sets the repository profile to the given profile.
- */
- VALUE
- repository_set_profile(VALUE self, VALUE profile)
- {
- try
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if ((**self_ptr).e_interface())
- (**self_ptr).e_interface()->set_profile(
- (**self_ptr).e_interface()->find_profile(
- value_to_profiles_desc_line(profile).path()));
- return Qnil;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * profile_variable(variable) -> String
- *
- * Fetches the named variable.
- */
- VALUE
- repository_profile_variable(VALUE self, VALUE var)
- {
- try
- {
- std::tr1::shared_ptr<Repository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<Repository>, self_ptr);
- if ((**self_ptr).e_interface())
- return rb_str_new2(((**self_ptr).e_interface()->profile_variable(StringValuePtr(var))).c_str());
- return Qnil;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * Document-method: arch
- *
- * call-seq:
- * arch -> String
- *
- * Fetch arch for this ProfilesDescLine.
- */
- /*
- * Document-method: status
- *
- * call-seq:
- * status -> String
- *
- * Fetch status for this ProfilesDescLine.
- */
- /*
- * Document-method: path
- *
- * call-seq:
- * path -> String
- *
- * Fetch path to this ProfilesDescLine.
- */
- template <typename K_, typename V_, NamedValue<V_, K_> (RepositoryEInterface::ProfilesDescLine::* f_)>
- struct DescLineValue
- {
- static VALUE
- fetch(VALUE self)
- {
- RepositoryEInterface::ProfilesDescLine * ptr;
- Data_Get_Struct(self, RepositoryEInterface::ProfilesDescLine, ptr);
- return rb_str_new2(stringify(((*ptr).*f_)()).c_str());
- }
- };
-
- /*
- * call-seq:
* add_category(category_name) -> Nil
*
* Add a category.
@@ -843,16 +683,8 @@ namespace
n::provides_interface, RepositoryProvidesInterface, &Repository::provides_interface>::fetch)), 0);
rb_define_method(c_repository, "virtuals_interface", RUBY_FUNC_CAST((&Interface<
n::virtuals_interface, RepositoryVirtualsInterface, &Repository::virtuals_interface>::fetch)), 0);
- rb_define_method(c_repository, "e_interface", RUBY_FUNC_CAST((&Interface<
- n::e_interface, RepositoryEInterface, &Repository::e_interface>::fetch)), 0);
-
rb_define_method(c_repository, "some_ids_might_support_action", RUBY_FUNC_CAST(&repository_some_ids_might_support_action), 1);
- rb_define_method(c_repository, "profiles", RUBY_FUNC_CAST(&repository_profiles),0);
- rb_define_method(c_repository, "find_profile", RUBY_FUNC_CAST(&repository_find_profile),1);
- rb_define_method(c_repository, "profile_variable", RUBY_FUNC_CAST(&repository_profile_variable),1);
- rb_define_method(c_repository, "set_profile", RUBY_FUNC_CAST(&repository_set_profile),1);
-
rb_define_method(c_repository, "[]", RUBY_FUNC_CAST(&repository_subscript), 1);
rb_define_method(c_repository, "each_metadata", RUBY_FUNC_CAST(&repository_each_metadata), 0);
rb_define_method(c_repository, "format_key",
@@ -867,20 +699,6 @@ namespace
rb_define_method(c_repository, "mirrors", RUBY_FUNC_CAST(&repository_mirrors), 1);
/*
- * Document-class: Paludis::ProfilesDescLine
- *
- *
- */
- c_profiles_desc_line = rb_define_class_under(paludis_module(), "ProfilesDescLine", rb_cObject);
- rb_funcall(c_profiles_desc_line, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_profiles_desc_line, "path",
- RUBY_FUNC_CAST((&DescLineValue<FSEntry, n::path, &RepositoryEInterface::ProfilesDescLine::path>::fetch)), 0);
- rb_define_method(c_profiles_desc_line, "arch",
- RUBY_FUNC_CAST((&DescLineValue<std::string, n::arch, &RepositoryEInterface::ProfilesDescLine::arch>::fetch)), 0);
- rb_define_method(c_profiles_desc_line, "status",
- RUBY_FUNC_CAST((&DescLineValue<std::string, n::status, &RepositoryEInterface::ProfilesDescLine::status>::fetch)), 0);
-
- /*
* Document-class: Paludis::FakeRepositoryBase
*
* A FakeRepositoryBase is a Repository subclass whose subclasses are used for
@@ -952,21 +770,6 @@ paludis::ruby::value_to_repository(VALUE v)
}
}
-RepositoryEInterface::ProfilesDescLine
-paludis::ruby::value_to_profiles_desc_line(VALUE v)
-{
- if (rb_obj_is_kind_of(v, c_profiles_desc_line))
- {
- RepositoryEInterface::ProfilesDescLine * v_ptr;
- Data_Get_Struct(v, RepositoryEInterface::ProfilesDescLine, v_ptr);
- return *v_ptr;
- }
- else
- {
- rb_raise(rb_eTypeError, "Can't convert %s into ProfilesDescLine", rb_obj_classname(v));
- }
-}
-
RegisterRubyClass::Register paludis_ruby_register_repository PALUDIS_ATTRIBUTE((used))
(&do_register_repository);
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index e382699..4d3f8a5 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -167,14 +167,14 @@ module Paludis
repo = no_config_testrepo.main_repository
[
:mirrors_interface, :environment_variable_interface,
- :provides_interface, :virtuals_interface, :e_interface].each do |sym|
+ :provides_interface, :virtuals_interface].each do |sym|
assert_respond_to repo, sym
end
end
def test_interfaces
assert_equal installed_repo.name, installed_repo.provides_interface.name
- assert_nil installed_repo.e_interface
+ assert_nil installed_repo.mirrors_interface
end
def text_repository_environment_interface
@@ -254,83 +254,6 @@ module Paludis
end
end
- class TestCase_RepositoryPortageInterface < Test::Unit::TestCase
- include RepositoryTestCase
-
- def test_responds
- repo = no_config_testrepo.main_repository
- [:profile_variable, :profiles, :find_profile, :set_profile].each do |sym|
- assert_respond_to repo, sym
- end
- end
-
- def test_profiles
- repo = no_config_testrepo.main_repository
- assert_kind_of Array, repo.profiles
- end
-
- def test_find_profile
- repo = no_config_testrepo.main_repository
- assert_nothing_raised do
- profile = repo.find_profile(Dir.getwd().to_s + '/repository_TEST_dir/testrepo/profiles/testprofile')
- assert_kind_of ProfilesDescLine, profile
- profile = repo.find_profile('broken')
- assert profile.nil?
- end
- end
-
- def test_set_profile
- repo = no_config_testrepo.main_repository
- assert_nothing_raised do
- profile = repo.profiles.first
- repo.set_profile(profile)
- end
- end
-
- def test_profile_variable
- repo = no_config_testrepo.main_repository
- assert_nothing_raised do
- assert_equal 'test', repo.profile_variable('ARCH')
- end
- end
- end
-
- class TestCase_ProfilesDescLine < Test::Unit::TestCase
- include RepositoryTestCase
-
- def profiles
- no_config_testrepo.main_repository.profiles
- end
-
- def test_profiles
- assert_kind_of Array, profiles
- assert_equal 1, profiles.length
- assert_kind_of ProfilesDescLine, profiles.first
- end
-
- def test_respond
- assert_respond_to profiles.first, :path
- assert_respond_to profiles.first, :arch
- assert_respond_to profiles.first, :status
- end
-
- def test_profile_path
- assert_kind_of String, profiles.first.path
- assert_equal Dir.getwd().to_s + "/repository_TEST_dir/testrepo/profiles/testprofile",
- profiles.first.path
- end
-
- def test_profile_arch
- assert_kind_of String, profiles.first.arch
- assert_equal 'x86', profiles.first.arch
- end
-
- def test_profile_status
- assert_kind_of String, profiles.first.status
- assert_equal 'stable', profiles.first.status
- end
- end
-
class TestCase_RepositorySomeIdsMightSupport < Test::Unit::TestCase
include RepositoryTestCase
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 8e808a8..2ef1be6 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -121,6 +121,7 @@ main(int argc, char *argv[])
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::profiles_if_not_auto>(""),
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())
diff --git a/src/clients/adjutrix/adjutrix.cc b/src/clients/adjutrix/adjutrix.cc
index 7f5a6b4..3e127da 100644
--- a/src/clients/adjutrix/adjutrix.cc
+++ b/src/clients/adjutrix/adjutrix.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 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
@@ -137,17 +137,18 @@ main(int argc, char *argv[])
extra_repository_dirs->push_back(*d);
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())
- ));
+ 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::profiles_if_not_auto>(CommandLine::get_instance()->a_profile.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/adjutrix/command_line.hh b/src/clients/adjutrix/command_line.hh
index f60265b..4614ad2 100644
--- a/src/clients/adjutrix/command_line.hh
+++ b/src/clients/adjutrix/command_line.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009 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
@@ -112,7 +112,7 @@ class CommandLine :
paludis::args::ArgsGroup profile_args;
- paludis::args::StringSetArg a_profile;
+ paludis::args::StringArg a_profile;
paludis::args::SwitchArg a_unstable;
///\}
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index 0d73204..02b4008 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -50,26 +50,11 @@ using namespace paludis;
namespace
{
int
- display_default_system_resolution(const NoConfigEnvironment & env, const std::string & desc,
- const FSEntry & profile)
+ display_default_system_resolution(const NoConfigEnvironment & env)
{
int return_code(0);
- Context context("When displaying system resolution for '" + stringify(desc) + "' at '"
- + stringify(profile) + "':");
-
- std::string display_profile(stringify(profile)), display_profile_chop(
- stringify(env.main_repository_dir() / "profiles"));
- if (0 == display_profile.compare(0, display_profile_chop.length(), display_profile_chop))
- {
- display_profile.erase(0, display_profile_chop.length());
- if (0 == display_profile.compare(0, 1, "/"))
- display_profile.erase(0, 1);
- if (display_profile.empty())
- display_profile = "/";
- }
-
- cout << std::left << std::setw(20) << (desc + ":") << display_profile << endl;
+ Context context("When displaying system resolution:");
DepListOptions d_options;
d_options.circular() = dl_circular_discard_silently;
@@ -111,8 +96,6 @@ namespace
int do_display_default_system_resolution(NoConfigEnvironment & env)
{
- int return_code(0);
-
Context context("When performing display-default-system-resolution action:");
if (env.default_destinations()->empty())
@@ -127,35 +110,7 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
env.package_database()->add_repository(1, fake_destination);
}
- if (CommandLine::get_instance()->a_profile.begin_args() ==
- CommandLine::get_instance()->a_profile.end_args())
- {
- for (RepositoryEInterface::ProfilesConstIterator
- p((*env.main_repository()).e_interface()->begin_profiles()),
- p_end((*env.main_repository()).e_interface()->end_profiles()) ; p != p_end ; ++p)
- {
- (*env.main_repository()).e_interface()->set_profile(p);
- return_code |= display_default_system_resolution(env, (*p).arch() + "." + (*p).status(), (*p).path());
- }
- }
- else
- {
- for (args::StringSetArg::ConstIterator i(CommandLine::get_instance()->a_profile.begin_args()),
- i_end(CommandLine::get_instance()->a_profile.end_args()) ; i != i_end ; ++i)
- {
- RepositoryEInterface::ProfilesConstIterator
- p((*env.main_repository()).e_interface()->find_profile(
- env.main_repository_dir() / "profiles" / (*i)));
- if (p == (*env.main_repository()).e_interface()->end_profiles())
- throw ConfigurationError("Repository does not have a profile listed in profiles.desc matching '"
- + stringify(*i) + "'");
- (*env.main_repository()).e_interface()->set_profile(p);
- return_code |= display_default_system_resolution(env, *i, env.main_repository_dir()
- / "profiles" / *i);
- }
- }
-
- return return_code;
+ return display_default_system_resolution(env);
}
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index cee22c5..8983815 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -78,38 +78,6 @@ namespace
return 0;
}
- std::string
- make_filename(const RepositoryEInterface::ProfilesConstIterator & p, bool unstable)
- {
- std::string result;
- FSEntry f((*p).path());
- while (f.basename() != "profiles" && f != FSEntry("/"))
- {
- result = f.basename() + (result.empty() ? "" : "_" + result);
- f = f.dirname();
- }
-
- result.append(unstable ? ".unstable.txt" : ".stable.txt");
-
- return result;
- }
-
- std::string
- make_desc(const RepositoryEInterface::ProfilesConstIterator & p, bool unstable)
- {
- std::string result;
- FSEntry f((*p).path());
- while (f.basename() != "profiles" && f != FSEntry("/"))
- {
- result = f.basename() + (result.empty() ? "" : "/" + result);
- f = f.dirname();
- }
-
- result.append(unstable ? " (unstable)" : " (stable)");
-
- return result;
- }
-
void
load_list(std::map<std::pair<QualifiedPackageName, std::string>, VersionSpec> & map, std::istream & f)
{
@@ -177,19 +145,13 @@ do_build_downgrade_check_list(NoConfigEnvironment & env)
if (! output_dir.mkdir())
throw ConfigurationError("Output directory already exists");
- for (RepositoryEInterface::ProfilesConstIterator
- p((*env.main_repository()).e_interface()->begin_profiles()),
- p_end((*env.main_repository()).e_interface()->end_profiles()) ; p != p_end ; ++p)
+ for (int i = 0 ; i < 2 ; ++i)
{
- for (int i = 0 ; i < 2 ; ++i)
- {
- env.set_accept_unstable(i);
- (*env.main_repository()).e_interface()->set_profile(p);
- std::string n(make_filename(p, i));
- std::cerr << "Generating " << n << "..." << std::endl;
- SafeOFStream f(output_dir / n);
- exit_status |= build_one_list(env, f);
- }
+ bool b(i);
+ env.set_accept_unstable(b);
+ std::cerr << "Generating " << (b ? "unstable" : "stable") << "..." << std::endl;
+ SafeOFStream f(output_dir / ((b ? "unstable" : "stable") + std::string(".txt")));
+ exit_status |= build_one_list(env, f);
}
return exit_status;
@@ -210,28 +172,24 @@ do_downgrade_check(NoConfigEnvironment & env)
std::multimap<std::pair<QualifiedPackageName, std::string>, std::string> results;
- for (RepositoryEInterface::ProfilesConstIterator
- p((*env.main_repository()).e_interface()->begin_profiles()),
- p_end((*env.main_repository()).e_interface()->end_profiles()) ; p != p_end ; ++p)
+ for (int i = 0 ; i < 2 ; ++i)
{
- for (int i = 0 ; i < 2 ; ++i)
- {
- env.set_accept_unstable(i);
- (*env.main_repository()).e_interface()->set_profile(p);
- std::string n(make_filename(p, i)), desc(make_desc(p, i));
+ bool b(i);
+ env.set_accept_unstable(b);
+ std::string f(b ? "unstable" : "stable");
+ f.append(".txt");
- if ((before_dir / n).exists() && (after_dir / n).exists())
- {
- std::cerr << "Checking " << n << "..." << std::endl;
+ if ((before_dir / f).exists() && (after_dir / f).exists())
+ {
+ std::cerr << "Checking " << (b ? "unstable" : "stable") << "..." << std::endl;
- SafeIFStream f1(before_dir / n);
- SafeIFStream f2(after_dir / n);
+ SafeIFStream f1(before_dir / f);
+ SafeIFStream f2(after_dir / f);
- exit_status |= check_one_list(env, f1, f2, results, desc);
- }
- else
- std::cerr << "Skipping " << n << "..." << std::endl;
+ exit_status |= check_one_list(env, f1, f2, results, b ? "unstable" : "stable");
}
+ else
+ std::cerr << "Skipping " << (b ? "unstable" : "stable") << "..." << std::endl;
}
std::pair<QualifiedPackageName, std::string> old_qpns(QualifiedPackageName("dummy/dummmy"),
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index d69b889..b2c281e 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -73,9 +73,6 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
KeywordName target_keyword(*CommandLine::get_instance()->begin_parameters());
std::string target_arch(strip_leading_string(*CommandLine::get_instance()->begin_parameters(), "~"));
- (*env.main_repository()).e_interface()->set_profile_by_arch(target_arch);
- env.set_accept_unstable('~' == stringify(target_keyword).at(0));
-
DepListOptions d_options;
d_options.circular() = dl_circular_discard_silently;
d_options.use() = dl_use_deps_take_all;
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index ceb2064..13a5f04 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -228,6 +228,7 @@ main(int argc, char *argv[])
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::profiles_if_not_auto>(""),
value_for<n::repository_dir>(get_location_and_add_filters()),
value_for<n::repository_type>(no_config_environment::ncer_ebuild),
value_for<n::write_cache>(CommandLine::get_instance()->a_write_cache_dir.argument())
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index b517774..4bbf64f 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -333,6 +333,7 @@ main(int argc, char *argv[])
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::profiles_if_not_auto>(""),
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())