aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2012-03-02 21:14:48 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2012-03-03 19:57:20 +0000
commit5ccbc4e8a9ef61c77ea4e891391cb8b0f4fe060a (patch)
tree3942cbf12eb99631b2591011884580d0f35b55cb
parent27e14ae3a2bf90e8e2fd285710442373fca5739c (diff)
downloadpaludis-5ccbc4e8a9ef61c77ea4e891391cb8b0f4fe060a.tar.gz
paludis-5ccbc4e8a9ef61c77ea4e891391cb8b0f4fe060a.tar.xz
Implement dsar_no_self_match
-rw-r--r--paludis/dep_spec_annotations.cc1
-rw-r--r--paludis/dep_spec_annotations.se2
-rw-r--r--paludis/match_package.cc4
3 files changed, 7 insertions, 0 deletions
diff --git a/paludis/dep_spec_annotations.cc b/paludis/dep_spec_annotations.cc
index 3263356..29ba67c 100644
--- a/paludis/dep_spec_annotations.cc
+++ b/paludis/dep_spec_annotations.cc
@@ -129,6 +129,7 @@ paludis::find_blocker_role_in_annotations(
case dsar_general_date:
case dsar_general_author:
case dsar_general_token:
+ case dsar_no_self_match:
case dsar_myoptions_requires:
case dsar_myoptions_n_at_least_one:
case dsar_myoptions_n_at_most_one:
diff --git a/paludis/dep_spec_annotations.se b/paludis/dep_spec_annotations.se
index 91d81ae..5e03b0e 100644
--- a/paludis/dep_spec_annotations.se
+++ b/paludis/dep_spec_annotations.se
@@ -16,6 +16,8 @@ make_enum_DepSpecAnnotationRole()
key dsar_general_token "A token"
key dsar_general_defined_in "Defined in"
+ key dsar_no_self_match "Spec doesn't match the containing package (checked by match_package)"
+
# update find_blocker_role_in_annotations when adding here
key dsar_blocker_manual "Blocker, resolve manually"
key dsar_blocker_uninstall_blocked_after "Blocker, uninstall blocked after"
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index a72f679..e6a95d4 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -19,6 +19,7 @@
#include <paludis/match_package.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_annotations.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/version_requirements.hh>
@@ -212,6 +213,9 @@ paludis::match_package_with_maybe_changes(
}
}
+ if (from_id && *id == *from_id && spec.maybe_annotations() && spec.maybe_annotations()->end() != spec.maybe_annotations()->find(dsar_no_self_match))
+ return false;
+
return true;
}