aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2015-12-11 03:16:31 +0100
committerAvatar Wouter van Kesteren <woutershep@gmail.com> 2016-01-08 19:00:03 +0100
commit6892a7edbc42236253136a72026528fb9cba1c47 (patch)
tree43cb3b1db76d49bcd580faa1fec7442826633fc7
parentdc7578140ad73f944502732a753e8a6aaedd1649 (diff)
downloadpaludis-6892a7edbc42236253136a72026528fb9cba1c47.tar.gz
paludis-6892a7edbc42236253136a72026528fb9cba1c47.tar.xz
Assert assumption made by merger
Error: ... * When loading EAPI data: * When loading EAPI file '/usr/share/paludis/eapis/pbin-1+exheres-0.conf': * EAPI configuration error: Merger code doesn't handle having both allow_empty_dirs and permitted_directories (paludis::erepository::EAPIConfigurationError) Change-Id: I89625552c6887039058de4882c47f5d588dfb064 Reviewed-on: https://galileo.mailstation.de/gerrit/4662 Reviewed-by: Bo ├śrsted Andresen <zlin@exherbo.org>
-rw-r--r--paludis/repositories/e/eapi.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index e91b51e..d1ab40e 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -346,6 +346,7 @@ namespace
version_spec_options += destringify<VersionSpecOption>(*t);
}
+ bool has_allow_empty_dirs(false);
MergerOptions merger_options;
{
std::list<std::string> merger_options_tokens;
@@ -353,7 +354,10 @@ namespace
for (std::list<std::string>::const_iterator t(merger_options_tokens.begin()),
t_end(merger_options_tokens.end()) ;
t != t_end ; ++t)
+ {
+ if (std::string("allow_empty_dirs") == *t) has_allow_empty_dirs = true;
merger_options += destringify<MergerOption>(*t);
+ }
}
FSMergerOptions fs_merger_options;
@@ -366,6 +370,12 @@ namespace
fs_merger_options += destringify<FSMergerOption>(*t);
}
+ auto permitted_directories = check_get(k, "permitted_directories");
+ if (has_allow_empty_dirs && std::string("") != permitted_directories)
+ {
+ throw EAPIConfigurationError("Merger code doesn't handle having both allow_empty_dirs and permitted_directories");
+ }
+
return std::make_shared<SupportedEAPI>(make_named_values<SupportedEAPI>(
n::allow_tokens_in_mask_files() = destringify_key<bool>(k, "allow_tokens_in_mask_files"),
n::annotations() = make_annotations(k),
@@ -384,7 +394,7 @@ namespace
n::package_dep_spec_parse_options() = package_dep_spec_parse_options,
n::parts_prefix() =
std::make_shared<ChoicePrefixName>(check_get(k, "parts_prefix")),
- n::permitted_directories() = check_get(k, "permitted_directories"),
+ n::permitted_directories() = permitted_directories,
n::pipe_commands() = make_pipe_commands(k),
n::profile_options() = make_profile_options(k),
n::tools_options() = make_tool_options(k),