aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2013-03-24 19:37:57 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2013-03-24 19:37:57 +0000
commited6dbaef9d15480ecb7faa3d9798d89b2c5b96fb (patch)
treee7f7770cdaf05ad0ea2313f4650f6020d03acd83
parenta8f004003a42125f8e60199906f45ed1038e1a71 (diff)
downloadpaludis-ed6dbaef9d15480ecb7faa3d9798d89b2c5b96fb.tar.gz
paludis-ed6dbaef9d15480ecb7faa3d9798d89b2c5b96fb.tar.xz
Handle /etc/portage/make.profile
-rw-r--r--paludis/environments/portage/portage_environment.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 7449f8c..687d4a7 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -258,7 +258,13 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
&do_incremental);
- _load_profile((_imp->conf_dir / "make.profile").realpath());
+ if ((_imp->conf_dir / "portage" / "make.profile").stat().is_directory_or_symlink_to_directory())
+ _load_profile((_imp->conf_dir / "portage" / "make.profile").realpath());
+ else if ((_imp->conf_dir / "make.profile").stat().is_directory_or_symlink_to_directory())
+ _load_profile((_imp->conf_dir / "make.profile").realpath());
+ else
+ throw PortageEnvironmentConfigurationError("Neither '" + stringify(_imp->conf_dir / "portage" / "make.profile")
+ + "' nor '" + stringify(_imp->conf_dir / "make.profile") + "' exists and is a directory");
if ((_imp->conf_dir / "make.conf").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.conf", KeyValueConfigFileOptions() +
@@ -496,7 +502,8 @@ PortageEnvironment::_add_ebuild_repository(const FSPath & portdir, const std::st
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(preferred_root_key()->parse_value()));
keys->insert("location", stringify(portdir));
- keys->insert("profiles", stringify((_imp->conf_dir / "make.profile").realpath()) + " " +
+ keys->insert("profiles", stringify(((_imp->conf_dir / "portage" / "make.profile").stat().is_directory_or_symlink_to_directory() ?
+ _imp->conf_dir / "portage" / "make.profile" : _imp->conf_dir / "make.profile").realpath()) + " " +
((_imp->conf_dir / "portage" / "profile").stat().is_directory() ?
stringify(_imp->conf_dir / "portage" / "profile") : ""));
keys->insert("format", "e");