aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-21 15:45:35 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-21 15:45:35 +0100
commit5a1ff81d033c315585562bb690587e24f7248607 (patch)
treefb775036a627d0181be2aca3b3d7eaf8da07ef5e
parent7da333dc63eaa2b3baa0cafebf6a3a6bc235e2d6 (diff)
downloadpaludis-5a1ff81d033c315585562bb690587e24f7248607.tar.gz
paludis-5a1ff81d033c315585562bb690587e24f7248607.tar.xz
Don't let test in use.conf override build_options:
Fixes: ticket:927
-rw-r--r--paludis/repositories/e/e_choices_key.cc18
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh2
-rw-r--r--paludis/repositories/e/e_repository_id.hh4
-rw-r--r--paludis/repositories/e/ebuild_id.cc8
-rw-r--r--paludis/repositories/e/ebuild_id.hh2
6 files changed, 22 insertions, 14 deletions
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 54dc236..ad40025 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -207,7 +207,7 @@ namespace
if (a->first == id->eapi()->supported()->annotations()->myoptions_description())
description = a->second;
}
- return id->make_choice_value(choice, v->first, s, b, description, false);
+ return id->make_choice_value(choice, v->first, s, false, b, description, false);
}
std::string get_maybe_description(const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & m,
@@ -437,8 +437,8 @@ EChoicesKey::populate_iuse() const
it_end(values.end()) ; it != it_end ; ++it)
{
std::tr1::shared_ptr<const ChoiceValue> choice(_imp->id->make_choice_value(
- use, UnprefixedChoiceName(stringify(it->first)), it->second.default_value(), ! it->second.implicit(),
- get_maybe_description(_imp->maybe_descriptions, it->first), false));
+ use, UnprefixedChoiceName(stringify(it->first)), it->second.default_value(), false,
+ ! it->second.implicit(), get_maybe_description(_imp->maybe_descriptions, it->first), false));
use->add(choice);
}
@@ -467,7 +467,7 @@ EChoicesKey::populate_iuse() const
/* don't need to worry */
}
else
- use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(stringify(flag.first)), flag.second, false,
+ use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(stringify(flag.first)), flag.second, false, false,
get_maybe_description(_imp->maybe_descriptions, flag.first), false));
}
}
@@ -489,7 +489,7 @@ EChoicesKey::populate_iuse() const
for (Set<UnprefixedChoiceName>::ConstIterator a(_imp->maybe_e_repository->arch_flags()->begin()), a_end(_imp->maybe_e_repository->arch_flags()->end()) ;
a != a_end ; ++a)
- arch->add(_imp->id->make_choice_value(arch, *a, indeterminate, false, "", false));
+ arch->add(_imp->id->make_choice_value(arch, *a, indeterminate, false, false, "", false));
}
if (_imp->id->raw_use_expand_key())
@@ -547,10 +547,10 @@ EChoicesKey::populate_iuse() const
{
std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator i(i_values.find(ChoiceNameWithPrefix(lower_u + delim + stringify(*v))));
if (i_values.end() != i)
- exp->add(_imp->id->make_choice_value(exp, *v, i->second.default_value(), ! i->second.implicit(),
+ exp->add(_imp->id->make_choice_value(exp, *v, i->second.default_value(), false, ! i->second.implicit(),
get_maybe_description(_imp->maybe_descriptions, i->first), false));
else
- exp->add(_imp->id->make_choice_value(exp, *v, indeterminate, false, "", false));
+ exp->add(_imp->id->make_choice_value(exp, *v, indeterminate, false, false, "", false));
}
}
}
@@ -566,12 +566,12 @@ EChoicesKey::populate_iuse() const
choice = _imp->value->find_by_name_with_prefix(ELikeOptionalTestsChoiceValue::canonical_name_with_prefix());
if (choice)
use->add(_imp->id->make_choice_value(use, UnprefixedChoiceName(_imp->id->eapi()->supported()->choices_options()->fancy_test_flag()),
- choice->enabled(), true, "", true));
+ choice->enabled(), true, true, "", true));
else
{
std::string name(_imp->id->eapi()->supported()->choices_options()->fancy_test_flag());
choice = _imp->id->make_choice_value(
- use, UnprefixedChoiceName(name), indeterminate, true,
+ use, UnprefixedChoiceName(name), indeterminate, true, true,
get_maybe_description(_imp->maybe_descriptions, ChoiceNameWithPrefix(name)), false);
use->add(choice);
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 80513a4..c24e75f 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -1008,7 +1008,7 @@ EInstalledRepositoryID::slot_key() const
std::tr1::shared_ptr<ChoiceValue>
EInstalledRepositoryID::make_choice_value(const std::tr1::shared_ptr<const Choice> & c, const UnprefixedChoiceName & v,
- const Tribool, const bool explicitly_listed, const std::string & override_description, const bool) const
+ const Tribool, const bool, const bool explicitly_listed, const std::string & override_description, const bool) const
{
if (! eapi()->supported())
throw InternalError(PALUDIS_HERE, "Unsupported EAPI");
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 5063798..01167d6 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -109,7 +109,7 @@ namespace paludis
virtual std::tr1::shared_ptr<ChoiceValue> make_choice_value(
const std::tr1::shared_ptr<const Choice> &, const UnprefixedChoiceName &, const Tribool,
- const bool, const std::string &, const bool) const;
+ const bool, const bool, const std::string &, const bool) const;
virtual void add_build_options(const std::tr1::shared_ptr<Choices> &) const;
diff --git a/paludis/repositories/e/e_repository_id.hh b/paludis/repositories/e/e_repository_id.hh
index 41c6286..ee90e6c 100644
--- a/paludis/repositories/e/e_repository_id.hh
+++ b/paludis/repositories/e/e_repository_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -49,7 +49,7 @@ namespace paludis
virtual std::tr1::shared_ptr<ChoiceValue> make_choice_value(
const std::tr1::shared_ptr<const Choice> &, const UnprefixedChoiceName &, const Tribool,
- const bool, const std::string &, const bool)
+ const bool, const bool, const std::string &, const bool)
const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual void add_build_options(const std::tr1::shared_ptr<Choices> &) const = 0;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 850270a..b09e172 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1275,6 +1275,7 @@ EbuildID::make_choice_value(
const std::tr1::shared_ptr<const Choice> & choice,
const UnprefixedChoiceName & value_name,
const Tribool iuse_default,
+ const bool iuse_default_wins,
const bool explicitly_listed,
const std::string & override_description,
const bool force_locked
@@ -1313,6 +1314,13 @@ EbuildID::make_choice_value(
locked = true;
enabled = enabled_by_default = true;
}
+ else if (iuse_default_wins && ! iuse_default.is_indeterminate())
+ {
+ if (iuse_default.is_true())
+ enabled_by_default = true;
+ else
+ enabled_by_default = false;
+ }
else
{
Tribool profile_want(_imp->repository->profile()->use_state_ignoring_masks(shared_from_this(), choice, value_name, name_with_prefix));
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 404f63e..27fd656 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -155,7 +155,7 @@ namespace paludis
virtual std::tr1::shared_ptr<ChoiceValue> make_choice_value(
const std::tr1::shared_ptr<const Choice> &, const UnprefixedChoiceName &, const Tribool,
- const bool, const std::string &, const bool) const;
+ const bool, const bool, const std::string &, const bool) const;
virtual void add_build_options(const std::tr1::shared_ptr<Choices> &) const;