aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-09-06 20:45:52 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-09-06 20:45:52 +0100
commitb77919a18ccc2863da8eece251618e2587124944 (patch)
tree58f65b22673faf5e219e3702d9186895bcb36553
parenteca10c830311c47692c5216dbe99d342fc50658a (diff)
downloadpaludis-b77919a18ccc2863da8eece251618e2587124944.tar.gz
paludis-b77919a18ccc2863da8eece251618e2587124944.tar.xz
Support !! blocks, but treat them and the ! variant the same for now.
-rw-r--r--paludis/dep_spec.cc8
-rw-r--r--paludis/dep_spec.hh1
-rw-r--r--paludis/repositories/e/dep_parser.cc14
-rw-r--r--paludis/repositories/e/dep_parser.se1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf2
5 files changed, 21 insertions, 5 deletions
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 2076e8f..535d217 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -279,6 +279,12 @@ BlockDepSpec::BlockDepSpec(std::tr1::shared_ptr<const PackageDepSpec> a) :
{
}
+BlockDepSpec::BlockDepSpec(const std::tr1::shared_ptr<const PackageDepSpec> & a, const std::string & t) :
+ StringDepSpec(t),
+ _spec(a)
+{
+}
+
std::ostream &
paludis::operator<< (std::ostream & s, const PlainTextDepSpec & a)
{
@@ -303,7 +309,7 @@ paludis::operator<< (std::ostream & s, const NamedSetDepSpec & a)
std::ostream &
paludis::operator<< (std::ostream & s, const BlockDepSpec & a)
{
- s << "!" << *a.blocked_spec();
+ s << a.text();
return s;
}
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index f7b8d04..b9475c5 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -782,6 +782,7 @@ namespace paludis
///\{
BlockDepSpec(std::tr1::shared_ptr<const PackageDepSpec> spec);
+ BlockDepSpec(const std::tr1::shared_ptr<const PackageDepSpec> & spec, const std::string & text);
///\}
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 6554eb6..b1c8030 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -102,9 +102,17 @@ namespace
{
if ((! s.empty()) && ('!' == s.at(0)))
{
+ std::string::size_type specstart(1);
+ if (2 <= s.length() && '!' == s.at(1))
+ {
+ if (! eapi.supported()->dependency_spec_tree_parse_options()[dstpo_hard_soft_blocks])
+ throw EDepParseError(s, "Double-! blocks not allowed in this EAPI");
+ specstart = 2;
+ }
+
std::tr1::shared_ptr<BlockDepSpec> spec(new BlockDepSpec(
- make_shared_ptr(new PackageDepSpec(parse_elike_package_dep_spec(s.substr(1),
- eapi.supported()->package_dep_spec_parse_options(), id)))));
+ make_shared_ptr(new PackageDepSpec(parse_elike_package_dep_spec(s.substr(specstart),
+ eapi.supported()->package_dep_spec_parse_options(), id))), s));
(*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, BlockDepSpec>(spec)));
annotations_go_here(spec);
}
@@ -161,7 +169,7 @@ namespace
annotations_go_here(spec);
}
else
- throw EDepParseError(s, "arrows in this EAPI");
+ throw EDepParseError(s, "Arrows not allowed in this EAPI");
}
void any_not_allowed_handler(const std::string & s) PALUDIS_ATTRIBUTE((noreturn));
diff --git a/paludis/repositories/e/dep_parser.se b/paludis/repositories/e/dep_parser.se
index 4dd2555..aa7a372 100644
--- a/paludis/repositories/e/dep_parser.se
+++ b/paludis/repositories/e/dep_parser.se
@@ -9,5 +9,6 @@ make_enum_DependencySpecTreeParseOption()
key dstpo_disallow_any_use "Disallow || ( use? ( ... ) )"
key dstpo_uri_supports_arrow "Allow -> in FetchableURIDepSpec"
+ key dstpo_hard_soft_blocks "Allow both !block and !!block"
}
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index cac58f2..9ac0819 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -8,7 +8,7 @@ can_be_pbin = true
package_dep_spec_parse_options = allow_slot_deps allow_use_deps allow_use_deps_portage allow_ranged_deps \
allow_repository_deps allow_tilde_greater_deps strict_parsing \
allow_slot_equal_deps allow_slot_star_deps
-dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow
+dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow hard_soft_blocks
iuse_flag_parse_options = allow_iuse_defaults
merger_options = rewrite_symlinks allow_empty_dirs
breaks_portage = true