aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-05 08:35:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-05 08:35:45 +0000
commita77b4f444434dade75ec5da21e52786e8e3e29c0 (patch)
tree46cb3cafb873cce1a889efd1dcee5dd1cda4a8c0
parent372def740a9ab60ed68f0359694657dfd732e1dd (diff)
downloadpaludis-a77b4f444434dade75ec5da21e52786e8e3e29c0.tar.gz
paludis-a77b4f444434dade75ec5da21e52786e8e3e29c0.tar.xz
use.conf and licenses.conf atomed entries can now override less specific entries' contents by using -*
-rw-r--r--NEWS3
-rw-r--r--paludis/environment/default/default_environment.cc62
2 files changed, 44 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index c0b5974..659a0e6 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ of every change, see the ChangeLog.
* Set names can now be used for the atom column in use.conf, keywords.conf,
licenses.conf, package_unmask.conf, package_mask.conf.
+ * use.conf and licenses.conf atomed entries can now override less specific
+ entries' contents by using "-*".
+
0.14.0:
* The merge and unmerge utilities are now called with an explicit path.
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index ada2505..8727892 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -365,12 +365,19 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
{
if (keyword == KeywordName("*"))
return true;
+ if (keyword == KeywordName("-*"))
+ return false;
Context context("When checking accept_keyword of '" + stringify(keyword) +
(d ? "' for " + stringify(*d) : stringify("'")) + ":");
bool result(false);
+ result |= DefaultConfig::get_instance()->end_default_keywords() !=
+ std::find(DefaultConfig::get_instance()->begin_default_keywords(),
+ DefaultConfig::get_instance()->end_default_keywords(),
+ keyword);
+
if (d)
{
for (DefaultConfig::PackageKeywordsIterator
@@ -381,7 +388,10 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
if (! match_package(this, k->first, d))
continue;
- result |= k->second == keyword;
+ if (k->second == KeywordName("-*"))
+ result = false;
+ else
+ result |= k->second == keyword;
}
for (DefaultConfig::SetKeywordsIterator
@@ -393,15 +403,13 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
if (! q(*d))
continue;
- result |= k->keyword == keyword;
+ if (k->keyword == KeywordName("-*"))
+ result = false;
+ else
+ result |= k->keyword == keyword;
}
}
- result |= DefaultConfig::get_instance()->end_default_keywords() !=
- std::find(DefaultConfig::get_instance()->begin_default_keywords(),
- DefaultConfig::get_instance()->end_default_keywords(),
- keyword);
-
return result;
}
@@ -410,12 +418,24 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
{
if (license == "*")
return true;
+ if (license == "-*")
+ return false;
Context context("When checking license of '" + license +
(d ? "' for " + stringify(*d) : stringify("'")) + ":");
bool result(false);
+ result |= DefaultConfig::get_instance()->end_default_licenses() !=
+ std::find(DefaultConfig::get_instance()->begin_default_licenses(),
+ DefaultConfig::get_instance()->end_default_licenses(),
+ license);
+
+ result |= DefaultConfig::get_instance()->end_default_licenses() !=
+ std::find(DefaultConfig::get_instance()->begin_default_licenses(),
+ DefaultConfig::get_instance()->end_default_licenses(),
+ "*");
+
if (d)
{
for (DefaultConfig::PackageLicensesIterator
@@ -426,8 +446,13 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
if (! match_package(this, k->first, d))
continue;
- result |= k->second == license;
- result |= k->second == "*";
+ if (k->second == "-*")
+ result = false;
+ else
+ {
+ result |= k->second == license;
+ result |= k->second == "*";
+ }
}
for (DefaultConfig::SetLicensesIterator
@@ -439,21 +464,16 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
if (! q(*d))
continue;
- result |= k->license == license;
- result |= k->license == "*";
+ if (k->license == "-*")
+ result = false;
+ else
+ {
+ result |= k->license == license;
+ result |= k->license == "*";
+ }
}
}
- result |= DefaultConfig::get_instance()->end_default_licenses() !=
- std::find(DefaultConfig::get_instance()->begin_default_licenses(),
- DefaultConfig::get_instance()->end_default_licenses(),
- license);
-
- result |= DefaultConfig::get_instance()->end_default_licenses() !=
- std::find(DefaultConfig::get_instance()->begin_default_licenses(),
- DefaultConfig::get_instance()->end_default_licenses(),
- "*");
-
return result;
}