aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-07 16:55:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-07 16:55:30 +0000
commit8179475606c74fb26c47a3dae7d0fb5042aa7e68 (patch)
treefc0af87bdf95e605f0291df32aa58d18d7ee7768
parentc810eb95bb62c7ce8fb8776330e4da0bdfc8559a (diff)
downloadpaludis-8179475606c74fb26c47a3dae7d0fb5042aa7e68.tar.gz
paludis-8179475606c74fb26c47a3dae7d0fb5042aa7e68.tar.xz
Allow * in keywords.conf to accept ebuilds with broken keywords (and make it actually work)
-rw-r--r--paludis/environment/default/default_environment.cc65
1 files changed, 33 insertions, 32 deletions
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index 0fe5d04..fb15c07 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -363,8 +363,8 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
bool
DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDatabaseEntry * const d) const
{
- static KeywordName star_keyword(KeywordName("*"));
- static KeywordName minus_star_keyword(KeywordName("-*"));
+ static KeywordName star_keyword("*");
+ static KeywordName minus_star_keyword("-*");
if (keyword == star_keyword)
return true;
@@ -389,40 +389,41 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
if (d)
{
- for (DefaultConfig::PackageKeywordsIterator
- k(DefaultConfig::get_instance()->begin_package_keywords(d->name)),
- k_end(DefaultConfig::get_instance()->end_package_keywords(d->name)) ;
+ for (DefaultConfig::SetKeywordsIterator
+ k(DefaultConfig::get_instance()->begin_set_keywords()),
+ k_end(DefaultConfig::get_instance()->end_set_keywords()) ;
k != k_end ; ++k)
{
- if (! match_package(this, k->first, d))
+ IsInSet q(this, k->dep_atom);
+ if (! q(*d))
continue;
- if (k->second == minus_star_keyword)
+ if (k->keyword == minus_star_keyword)
result = false;
else
{
- result |= k->second == keyword;
- result |= k->second == star_keyword;
+ result |= k->keyword == keyword;
+ result |= k->keyword == star_keyword;
}
}
- for (DefaultConfig::SetKeywordsIterator
- k(DefaultConfig::get_instance()->begin_set_keywords()),
- k_end(DefaultConfig::get_instance()->end_set_keywords()) ;
+ for (DefaultConfig::PackageKeywordsIterator
+ k(DefaultConfig::get_instance()->begin_package_keywords(d->name)),
+ k_end(DefaultConfig::get_instance()->end_package_keywords(d->name)) ;
k != k_end ; ++k)
{
- IsInSet q(this, k->dep_atom);
- if (! q(*d))
+ if (! match_package(this, k->first, d))
continue;
- if (k->keyword == minus_star_keyword)
+ if (k->second == minus_star_keyword)
result = false;
else
{
- result |= k->keyword == keyword;
- result |= k->keyword == star_keyword;
+ result |= k->second == keyword;
+ result |= k->second == star_keyword;
}
}
+
}
return result;
@@ -453,38 +454,38 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
if (d)
{
- for (DefaultConfig::PackageLicensesIterator
- k(DefaultConfig::get_instance()->begin_package_licenses(d->name)),
- k_end(DefaultConfig::get_instance()->end_package_licenses(d->name)) ;
+ for (DefaultConfig::SetLicensesIterator
+ k(DefaultConfig::get_instance()->begin_set_licenses()),
+ k_end(DefaultConfig::get_instance()->end_set_licenses()) ;
k != k_end ; ++k)
{
- if (! match_package(this, k->first, d))
+ IsInSet q(this, k->dep_atom);
+ if (! q(*d))
continue;
- if (k->second == "-*")
+ if (k->license == "-*")
result = false;
else
{
- result |= k->second == license;
- result |= k->second == "*";
+ result |= k->license == license;
+ result |= k->license == "*";
}
}
- for (DefaultConfig::SetLicensesIterator
- k(DefaultConfig::get_instance()->begin_set_licenses()),
- k_end(DefaultConfig::get_instance()->end_set_licenses()) ;
+ for (DefaultConfig::PackageLicensesIterator
+ k(DefaultConfig::get_instance()->begin_package_licenses(d->name)),
+ k_end(DefaultConfig::get_instance()->end_package_licenses(d->name)) ;
k != k_end ; ++k)
{
- IsInSet q(this, k->dep_atom);
- if (! q(*d))
+ if (! match_package(this, k->first, d))
continue;
- if (k->license == "-*")
+ if (k->second == "-*")
result = false;
else
{
- result |= k->license == license;
- result |= k->license == "*";
+ result |= k->second == license;
+ result |= k->second == "*";
}
}
}