diff options
-rw-r--r-- | paludis/elike_choices-fwd.hh | 3 | ||||
-rw-r--r-- | paludis/elike_choices.cc | 19 | ||||
-rw-r--r-- | paludis/repositories/e/pipe_command_handler.cc | 3 |
3 files changed, 25 insertions, 0 deletions
diff --git a/paludis/elike_choices-fwd.hh b/paludis/elike_choices-fwd.hh index 25df2e837..37ab43f90 100644 --- a/paludis/elike_choices-fwd.hh +++ b/paludis/elike_choices-fwd.hh @@ -22,6 +22,7 @@ #include <paludis/util/attributes.hh> #include <paludis/choice-fwd.hh> +#include <memory> #include <string> #include <iosfwd> @@ -31,6 +32,7 @@ namespace paludis struct ELikeRecommendedTestsChoiceValue; struct ELikeExpensiveTestsChoiceValue; struct ELikeJobsChoiceValue; + struct ELikeTraceChoiceValue; struct ELikePreserveWorkChoiceValue; struct ELikeSymbolsChoiceValue; @@ -40,6 +42,7 @@ namespace paludis #include <paludis/elike_choices-se.hh> + bool is_special_elike_choice_value(const std::shared_ptr<const ChoiceValue> &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result)); } #endif diff --git a/paludis/elike_choices.cc b/paludis/elike_choices.cc index d7cd238c7..0425bf7fc 100644 --- a/paludis/elike_choices.cc +++ b/paludis/elike_choices.cc @@ -28,6 +28,7 @@ #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/util/enum_iterator.hh> #include <paludis/util/map.hh> +#include <set> #include <limits> #include <istream> #include <ostream> @@ -716,3 +717,21 @@ ELikeSymbolsChoiceValue::should_compress(const std::string & v) throw InternalError(PALUDIS_HERE, "Unhandled ELikeSymbolsChoiceValueParameter"); } + +bool +paludis::is_special_elike_choice_value( + const std::shared_ptr<const ChoiceValue> & v) +{ + static const std::set<std::string> specials({ + stringify(ELikeOptionalTestsChoiceValue::canonical_name_with_prefix()), + stringify(ELikeRecommendedTestsChoiceValue::canonical_name_with_prefix()), + stringify(ELikeExpensiveTestsChoiceValue::canonical_name_with_prefix()), + stringify(ELikeJobsChoiceValue::canonical_name_with_prefix()), + stringify(ELikeTraceChoiceValue::canonical_name_with_prefix()), + stringify(ELikePreserveWorkChoiceValue::canonical_name_with_prefix()), + stringify(ELikeSymbolsChoiceValue::canonical_name_with_prefix()) + }); + + return specials.end() != specials.find(stringify(v->name_with_prefix())); +} + diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc index 77f69018a..bde711efa 100644 --- a/paludis/repositories/e/pipe_command_handler.cc +++ b/paludis/repositories/e/pipe_command_handler.cc @@ -447,6 +447,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment return "EOPTIONQ ID " + stringify(*package_id) + " has no choice named '" + stringify(name) + "'"; } + if (is_special_elike_choice_value(value)) + return "Ecannot query option '" + stringify(name) + "' for ID " + stringify(*package_id); + if (value->enabled()) return "O0;"; else |