aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-16 03:20:28 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-16 03:20:28 +0000
commit9c7c820168a836afaa256008be1883fbce630a1c (patch)
treecca0f994e081e3c37044e29ea7d635b21d97e5b8
parentf2029ff168647fb4f3fa21ea8cf8adedc150117f (diff)
downloadpaludis-9c7c820168a836afaa256008be1883fbce630a1c.tar.gz
paludis-9c7c820168a836afaa256008be1883fbce630a1c.tar.xz
Switch syntax for ranged dependencies, and allow it for user and paludis EAPIs. Enable wildcard category and package parts in dep specs. Only allow unspecific dep specs where appropriate.
-rw-r--r--paludis/dep_list/dep_list_TEST.cc40
-rw-r--r--paludis/dep_list/dep_list_TEST_blockers.cc16
-rw-r--r--paludis/dep_list/range_rewriter_TEST.cc4
-rw-r--r--paludis/dep_list/uninstall_list_TEST.cc4
-rw-r--r--paludis/dep_spec.cc269
-rw-r--r--paludis/dep_spec_TEST.cc94
-rw-r--r--paludis/set_file.cc2
-rw-r--r--paludis/tasks/install_task.cc4
-rw-r--r--paludis/tasks/uninstall_task.cc4
-rw-r--r--ruby/dep_spec.cc4
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc2
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc2
-rw-r--r--src/clients/contrarius/stage.cc20
-rw-r--r--src/clients/paludis/do_config.cc2
-rw-r--r--src/clients/paludis/do_contents.cc2
-rw-r--r--src/clients/paludis/query.cc2
16 files changed, 359 insertions, 112 deletions
diff --git a/paludis/dep_list/dep_list_TEST.cc b/paludis/dep_list/dep_list_TEST.cc
index c664606..79ef7f3 100644
--- a/paludis/dep_list/dep_list_TEST.cc
+++ b/paludis/dep_list/dep_list_TEST.cc
@@ -951,7 +951,7 @@ namespace test_cases
{
TEST_CHECK(true);
DepList d(&env, DepListOptions());
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -978,7 +978,7 @@ namespace test_cases
{
TEST_CHECK(true);
DepList d(&env, DepListOptions());
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -1045,7 +1045,7 @@ namespace test_cases
{
TEST_CHECK(true);
DepList d(&env, DepListOptions());
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -1072,7 +1072,7 @@ namespace test_cases
{
TEST_CHECK(true);
DepList d(&env, DepListOptions());
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -1273,11 +1273,11 @@ namespace test_cases
repo->add_version("cat", "seven", "1")->deps_interface->build_depend_string = "cat/doesnotexist";
DepList d(&env, DepListOptions());
- d.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific), env.default_destinations());
+ d.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d.begin(), d.end(), " "),
"cat/four-1:0::repo cat/two-1:0::repo cat/three-1:0::repo cat/one-1:0::repo");
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend("cat/five", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend("cat/five", pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK_EQUAL(join(d.begin(), d.end(), " "),
@@ -1311,11 +1311,11 @@ namespace test_cases
repo->add_version("cat", "seven", "1")->deps_interface->post_depend_string = "cat/doesnotexist";
DepList d(&env, DepListOptions());
- d.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific), env.default_destinations());
+ d.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d.begin(), d.end(), " "),
"cat/four-1:0::repo cat/two-1:0::repo cat/three-1:0::repo cat/one-1:0::repo");
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend("cat/five", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend("cat/five", pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK_EQUAL(join(d.begin(), d.end(), " "),
@@ -1345,7 +1345,7 @@ namespace test_cases
installed_repo->add_version("cat", "one", "2");
DepList d(&env, DepListOptions());
- d.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific), env.default_destinations());
+ d.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d.begin(), d.end(), " "), "cat/one-1:0::repo");
}
} test_dep_list_forced_downgrade_of_installed;
@@ -1372,7 +1372,7 @@ namespace test_cases
DepList d(&env, DepListOptions());
d.options()->fall_back = dl_fall_back_never;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive),
env.default_destinations()), DepListError);
}
} test_dep_list_fall_back_never;
@@ -1399,8 +1399,8 @@ namespace test_cases
DepList d(&env, DepListOptions());
d.options()->fall_back = dl_fall_back_as_needed;
- d.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific), env.default_destinations());
- d.add(PortageDepParser::parse_depend("cat/two", pds_pm_unspecific), env.default_destinations());
+ d.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive), env.default_destinations());
+ d.add(PortageDepParser::parse_depend("cat/two", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d.begin(), d.end(), " "), "cat/two-2:0::installed_repo cat/one-1:0::repo");
}
} test_dep_list_fall_back_as_needed;
@@ -1428,24 +1428,24 @@ namespace test_cases
DepList d1(&env, DepListOptions());
d1.options()->fall_back = dl_fall_back_as_needed_except_targets;
- d1.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific), env.default_destinations());
+ d1.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d1.begin(), d1.end(), " "), "cat/two-2:0::installed_repo cat/one-1:0::repo");
- TEST_CHECK_THROWS(d1.add(PortageDepParser::parse_depend("cat/three", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d1.add(PortageDepParser::parse_depend("cat/three", pds_pm_permissive),
env.default_destinations()), DepListError);
DepList d2(&env, DepListOptions());
d2.options()->fall_back = dl_fall_back_as_needed_except_targets;
- TEST_CHECK_THROWS(d2.add(PortageDepParser::parse_depend("cat/two", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d2.add(PortageDepParser::parse_depend("cat/two", pds_pm_permissive),
env.default_destinations()), DepListError);
DepList d3(&env, DepListOptions());
d3.options()->fall_back = dl_fall_back_as_needed_except_targets;
- TEST_CHECK_THROWS(d3.add(PortageDepParser::parse_depend("( cat/one cat/two )", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d3.add(PortageDepParser::parse_depend("( cat/one cat/two )", pds_pm_permissive),
env.default_destinations()), DepListError);
DepList d4(&env, DepListOptions());
d4.options()->fall_back = dl_fall_back_as_needed_except_targets;
- TEST_CHECK_THROWS(d4.add(PortageDepParser::parse_depend("( cat/one cat/three )", pds_pm_unspecific),
+ TEST_CHECK_THROWS(d4.add(PortageDepParser::parse_depend("( cat/one cat/three )", pds_pm_permissive),
env.default_destinations()), DepListError);
}
} test_dep_list_fall_back_as_needed_not_targets;
@@ -1473,12 +1473,12 @@ namespace test_cases
DepList d1(&env, DepListOptions());
d1.options()->upgrade = dl_upgrade_as_needed;
- d1.add(PortageDepParser::parse_depend("cat/one", pds_pm_unspecific), env.default_destinations());
+ d1.add(PortageDepParser::parse_depend("cat/one", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d1.begin(), d1.end(), " "), "cat/two-0:0::installed_repo cat/one-1:0::repo");
DepList d2(&env, DepListOptions());
d2.options()->upgrade = dl_upgrade_as_needed;
- d2.add(PortageDepParser::parse_depend("( cat/one cat/two )", pds_pm_unspecific), env.default_destinations());
+ d2.add(PortageDepParser::parse_depend("( cat/one cat/two )", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d2.begin(), d2.end(), " "), "cat/two-2:0::repo cat/one-1:0::repo");
}
} test_dep_list_upgrade_as_needed;
@@ -1517,7 +1517,7 @@ namespace test_cases
DepList d1(&env, DepListOptions());
d1.options()->reinstall_scm = dl_reinstall_scm_always;
- d1.add(PortageDepParser::parse_depend("cat/zero", pds_pm_unspecific), env.default_destinations());
+ d1.add(PortageDepParser::parse_depend("cat/zero", pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(join(d1.begin(), d1.end(), " "), "cat/one-scm:0::repo cat/two-2:0::installed_repo "
"cat/three-live-0:0::repo cat/four-cvs-0:0::repo cat/five-svn-0:0::repo cat/six-darcs-0:0::repo "
"cat/zero-1:0::repo");
diff --git a/paludis/dep_list/dep_list_TEST_blockers.cc b/paludis/dep_list/dep_list_TEST_blockers.cc
index 926972d..dc88bd4 100644
--- a/paludis/dep_list/dep_list_TEST_blockers.cc
+++ b/paludis/dep_list/dep_list_TEST_blockers.cc
@@ -44,12 +44,12 @@ namespace test_cases
TEST_CHECK(true);
DepList d(&env, DepListOptions());
d.options()->blocks = dl_blocks_error;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
d.options()->blocks = dl_blocks_accumulate;
- d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific), env.default_destinations());
+ d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(std::distance(d.begin(), d.end()), 2);
TEST_CHECK_EQUAL(d.begin()->kind, dlk_block);
TEST_CHECK_STRINGIFY_EQUAL(d.begin()->package, "cat/two-1::installed");
@@ -120,12 +120,12 @@ namespace test_cases
TEST_CHECK(true);
DepList d(&env, DepListOptions());
d.options()->blocks = dl_blocks_error;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
d.options()->blocks = dl_blocks_accumulate;
- d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific), env.default_destinations());
+ d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive), env.default_destinations());
TEST_CHECK_EQUAL(std::distance(d.begin(), d.end()), 4);
TEST_CHECK_EQUAL(d.begin()->kind, dlk_block);
TEST_CHECK_STRINGIFY_EQUAL(d.begin()->package, "virtual/two-1::installed_virtuals");
@@ -159,7 +159,7 @@ namespace test_cases
TEST_CHECK(true);
DepList d(&env, DepListOptions());
d.options()->blocks = dl_blocks_error;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -299,7 +299,7 @@ namespace test_cases
TEST_CHECK(true);
DepList d(&env, DepListOptions());
d.options()->blocks = dl_blocks_error;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -328,7 +328,7 @@ namespace test_cases
TEST_CHECK(true);
DepList d(&env, DepListOptions());
d.options()->blocks = dl_blocks_error;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
@@ -357,7 +357,7 @@ namespace test_cases
TEST_CHECK(true);
DepList d(&env, DepListOptions());
d.options()->blocks = dl_blocks_error;
- TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_unspecific),
+ TEST_CHECK_THROWS(d.add(PortageDepParser::parse_depend(merge_target, pds_pm_permissive),
env.default_destinations()), DepListError);
TEST_CHECK(d.begin() == d.end());
}
diff --git a/paludis/dep_list/range_rewriter_TEST.cc b/paludis/dep_list/range_rewriter_TEST.cc
index ff0696d..adb3cc8 100644
--- a/paludis/dep_list/range_rewriter_TEST.cc
+++ b/paludis/dep_list/range_rewriter_TEST.cc
@@ -37,7 +37,7 @@ namespace test_cases
void run()
{
- std::tr1::shared_ptr<const CompositeDepSpec> p(PortageDepParser::parse_depend("=a/b-1 =a/b-2", pds_pm_unspecific));
+ std::tr1::shared_ptr<const CompositeDepSpec> p(PortageDepParser::parse_depend("=a/b-1 =a/b-2", pds_pm_permissive));
RangeRewriter r;
TEST_CHECK(! r.spec());
@@ -46,7 +46,7 @@ namespace test_cases
DepSpecPrettyPrinter w(0, false);
r.spec()->accept(&w);
- TEST_CHECK_STRINGIFY_EQUAL(w, "=|=a/b-1,2 ");
+ TEST_CHECK_STRINGIFY_EQUAL(w, "a/b[=1|=2] ");
}
} test_range_rewriter;
}
diff --git a/paludis/dep_list/uninstall_list_TEST.cc b/paludis/dep_list/uninstall_list_TEST.cc
index 6cb7c0f..4c82551 100644
--- a/paludis/dep_list/uninstall_list_TEST.cc
+++ b/paludis/dep_list/uninstall_list_TEST.cc
@@ -325,7 +325,7 @@ namespace test_cases
UninstallListTestCaseBase("with unused deps world")
{
installed_repo->add_package_set(SetName("world"), PortageDepParser::parse(
- "foo/moo", PortageDepParser::Policy::text_is_package_dep_spec(true, pds_pm_unspecific)));
+ "foo/moo", PortageDepParser::Policy::text_is_package_dep_spec(true, pds_pm_permissive)));
}
void populate_targets()
@@ -361,7 +361,7 @@ namespace test_cases
UninstallListTestCaseBase("with unused deps world target")
{
installed_repo->add_package_set(SetName("world"), PortageDepParser::parse(
- "foo/bar foo/moo", PortageDepParser::Policy::text_is_package_dep_spec(true, pds_pm_unspecific)));
+ "foo/bar foo/moo", PortageDepParser::Policy::text_is_package_dep_spec(true, pds_pm_permissive)));
}
void populate_targets()
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index d88aa20..e0546cb 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -229,7 +229,7 @@ PackageDepSpec::PackageDepSpec(const std::string & ss) :
std::tr1::shared_ptr<UseRequirements>(),
std::tr1::shared_ptr<const DepTag>()))
{
- _do_parse(ss, pds_pm_unspecific);
+ _do_parse(ss, pds_pm_permissive);
_imp->unique = true;
}
@@ -296,33 +296,107 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
break;
case pds_pm_eapi_0:
- Log::get_instance()->message(ll_warning, lc_context, "Use dependencies not safe for use with this EAPI");
+ Log::get_instance()->message(ll_warning, lc_context, "[] dependencies not safe for use with this EAPI");
break;
case pds_pm_eapi_0_strict:
- throw PackageDepSpecError("Use dependencies not safe for use with this EAPI");
+ throw PackageDepSpecError("[] dependencies not safe for use with this EAPI");
}
if (s.at(s.length() - 1) != ']')
throw PackageDepSpecError("Mismatched []");
std::string flag(s.substr(use_group_p + 1));
- UseFlagState state(use_enabled);
if (flag.length() < 2)
throw PackageDepSpecError("Invalid [] contents");
+
flag.erase(flag.length() - 1);
- if ('-' == flag.at(0))
+
+ switch (flag.at(0))
{
- state = use_disabled;
- flag.erase(0, 1);
- if (flag.empty())
- throw PackageDepSpecError("Invalid [] contents");
- }
- UseFlagName name(flag);
- if (! _imp->use_requirements)
- _imp->use_requirements.reset(new UseRequirements);
- if (! _imp->use_requirements->insert(name, state))
- throw PackageDepSpecError("Conflicting [] contents");
+ case '<':
+ case '>':
+ case '=':
+ case '~':
+ {
+ _imp->version_requirements.reset(new VersionRequirements::Concrete);
+ char needed_mode(0);
+
+ while (! flag.empty())
+ {
+ Context cc("When parsing [] segment '" + flag + "':");
+
+ std::string op;
+ std::string::size_type opos(0);
+ while (opos < flag.length())
+ if (std::string::npos == std::string("><=~").find(flag.at(opos)))
+ break;
+ else
+ ++opos;
+
+ op = flag.substr(0, opos);
+ flag.erase(0, opos);
+
+ if (op.empty())
+ throw PackageDepSpecError("Missing operator inside []");
+
+ VersionOperator vop(op);
+
+ std::string ver;
+ opos = flag.find_first_of("|&");
+ if (std::string::npos == opos)
+ {
+ ver = flag;
+ flag.clear();
+ }
+ else
+ {
+ if (0 == needed_mode)
+ needed_mode = flag.at(opos);
+ else if (needed_mode != flag.at(opos))
+ throw PackageDepSpecError("Mixed & and | inside []");
+
+ _imp->version_requirements_mode = (flag.at(opos) == '|' ? vr_or : vr_and);
+ ver = flag.substr(0, opos++);
+ flag.erase(0, opos);
+ }
+
+ if (ver.empty())
+ throw PackageDepSpecError("Missing version after operator '" + stringify(vop) + " inside []");
+
+ if ('*' == ver.at(ver.length() - 1))
+ {
+ ver.erase(ver.length() - 1);
+ if (vop == vo_equal)
+ vop = vo_equal_star;
+ else
+ throw PackageDepSpecError("Invalid use of * with operator '" + stringify(vop) + " inside []");
+ }
+
+ VersionSpec vs(ver);
+ _imp->version_requirements->push_back(VersionRequirement(vop, vs));
+ }
+ }
+ break;
+
+ default:
+ {
+ UseFlagState state(use_enabled);
+ if ('-' == flag.at(0))
+ {
+ state = use_disabled;
+ flag.erase(0, 1);
+ if (flag.empty())
+ throw PackageDepSpecError("Invalid [] contents");
+ }
+ UseFlagName name(flag);
+ if (! _imp->use_requirements)
+ _imp->use_requirements.reset(new UseRequirements);
+ if (! _imp->use_requirements->insert(name, state))
+ throw PackageDepSpecError("Conflicting [] contents");
+ }
+ break;
+ };
s.erase(use_group_p);
}
@@ -373,6 +447,9 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
if (std::string::npos != std::string("<>=~").find(s.at(0)))
{
+ if (_imp->version_requirements)
+ throw PackageDepSpecError("Cannot mix [] and traditional version specifications");
+
std::string::size_type p(1);
if (s.length() > 1 && std::string::npos != std::string("<>=~").find(s.at(1)))
++p;
@@ -419,7 +496,26 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
q = new_q;
}
- _imp->package_ptr.reset(new QualifiedPackageName(s.substr(p, q - p - 1)));
+ std::string t(s.substr(p, q - p - 1));
+ if (t.length() >= 3 && (0 == t.compare(0, 2, "*/")))
+ {
+ if (pds_pm_unspecific != mode)
+ throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with parse mode '"
+ + stringify(mode) + "'");
+
+ if (0 != t.compare(t.length() - 2, 2, "/*"))
+ _imp->package_name_part_ptr.reset(new PackageNamePart(t.substr(2)));
+ }
+ else if (t.length() >= 3 && (0 == t.compare(t.length() - 2, 2, "/*")))
+ {
+ if (pds_pm_unspecific != mode)
+ throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with parse mode '"
+ + stringify(mode) + "'");
+
+ _imp->category_name_part_ptr.reset(new CategoryNamePart(t.substr(0, t.length() - 2)));
+ }
+ else
+ _imp->package_ptr.reset(new QualifiedPackageName(t));
_imp->version_requirements.reset(new VersionRequirements::Concrete);
@@ -453,7 +549,27 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
_imp->version_requirements->push_back(VersionRequirement(op, VersionSpec(s.substr(q))));
}
else
- _imp->package_ptr.reset(new QualifiedPackageName(s));
+ {
+ if (s.length() >= 3 && (0 == s.compare(0, 2, "*/")))
+ {
+ if (pds_pm_unspecific != mode)
+ throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with parse mode '"
+ + stringify(mode) + "'");
+
+ if (0 != s.compare(s.length() - 2, 2, "/*"))
+ _imp->package_name_part_ptr.reset(new PackageNamePart(s.substr(2)));
+ }
+ else if (s.length() >= 3 && (0 == s.compare(s.length() - 2, 2, "/*")))
+ {
+ if (pds_pm_unspecific != mode)
+ throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with parse mode '"
+ + stringify(mode) + "'");
+
+ _imp->category_name_part_ptr.reset(new CategoryNamePart(s.substr(0, s.length() - 2)));
+ }
+ else
+ _imp->package_ptr.reset(new QualifiedPackageName(s));
+ }
}
catch (Exception &)
{
@@ -482,60 +598,45 @@ paludis::operator<< (std::ostream & s, const PackageDepSpec & a)
{
if (a.version_requirements_ptr())
{
- bool need_op(false);
- for (VersionRequirements::Iterator r(a.version_requirements_ptr()->begin()),
- r_end(a.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ if (a.version_requirements_ptr()->begin() == a.version_requirements_ptr()->end())
{
- if (need_op)
- {
- switch (a.version_requirements_mode())
- {
- case vr_and:
- s << "&";
- break;
-
- case vr_or:
- s << "|";
- break;
-
- case last_vr:
- ;
- }
- }
-
- if (r->version_operator == vo_equal_star)
+ }
+ else if (next(a.version_requirements_ptr()->begin()) == a.version_requirements_ptr()->end())
+ {
+ if (a.version_requirements_ptr()->begin()->version_operator == vo_equal_star)
s << "=";
else
- s << r->version_operator;
-
- need_op = true;
+ s << a.version_requirements_ptr()->begin()->version_operator;
}
}
if (a.package_ptr())
s << *a.package_ptr();
-
- if (a.version_requirements_ptr())
+ else
{
- bool need_comma(false), need_hyphen(true);
- for (VersionRequirements::Iterator r(a.version_requirements_ptr()->begin()),
- r_end(a.version_requirements_ptr()->end()) ; r != r_end ; ++r)
- {
- if (need_comma)
- s << ",";
+ if (a.category_name_part_ptr())
+ s << *a.category_name_part_ptr();
+ else
+ s << "*";
- if (need_hyphen)
- {
- s << "-";
- need_hyphen = false;
- }
+ s << "/";
- s << r->version_spec;
+ if (a.package_name_part_ptr())
+ s << *a.package_name_part_ptr();
+ else
+ s << "*";
+ }
- if (r->version_operator == vo_equal_star)
+ if (a.version_requirements_ptr())
+ {
+ if (a.version_requirements_ptr()->begin() == a.version_requirements_ptr()->end())
+ {
+ }
+ else if (next(a.version_requirements_ptr()->begin()) == a.version_requirements_ptr()->end())
+ {
+ s << "-" << a.version_requirements_ptr()->begin()->version_spec;
+ if (a.version_requirements_ptr()->begin()->version_operator == vo_equal_star)
s << "*";
-
- need_comma = true;
}
}
@@ -544,6 +645,58 @@ paludis::operator<< (std::ostream & s, const PackageDepSpec & a)
if (a.repository_ptr())
s << "::" << *a.repository_ptr();
+ if (a.version_requirements_ptr())
+ {
+ if (a.version_requirements_ptr()->begin() == a.version_requirements_ptr()->end())
+ {
+ }
+ else if (next(a.version_requirements_ptr()->begin()) == a.version_requirements_ptr()->end())
+ {
+ }
+ else
+ {
+ bool need_op(false);
+ s << "[";
+ for (VersionRequirements::Iterator r(a.version_requirements_ptr()->begin()),
+ r_end(a.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ {
+ if (need_op)
+ {
+ do
+ {
+ switch (a.version_requirements_mode())
+ {
+ case vr_and:
+ s << "&";
+ continue;
+
+ case vr_or:
+ s << "|";
+ continue;
+
+ case last_vr:
+ ;
+ }
+ throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
+ } while (false);
+ }
+
+ if (r->version_operator == vo_equal_star)
+ s << "=";
+ else
+ s << r->version_operator;
+
+ s << r->version_spec;
+
+ if (r->version_operator == vo_equal_star)
+ s << "*";
+
+ need_op = true;
+ }
+ s << "]";
+ }
+ }
+
if (a.use_requirements_ptr())
{
for (UseRequirements::Iterator u(a.use_requirements_ptr()->begin()),
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 6e3aecd..341670d 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -84,11 +84,13 @@ namespace test_cases
void run()
{
PackageDepSpec a("foo/bar", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(a, "foo/bar");
TEST_CHECK_STRINGIFY_EQUAL(*a.package_ptr(), "foo/bar");
TEST_CHECK(! a.slot_ptr());
TEST_CHECK(! a.version_requirements_ptr());
PackageDepSpec b(">=foo/bar-1.2.3", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(b, ">=foo/bar-1.2.3");
TEST_CHECK_STRINGIFY_EQUAL(*b.package_ptr(), "foo/bar");
TEST_CHECK(! b.slot_ptr());
TEST_CHECK(b.version_requirements_ptr());
@@ -98,12 +100,14 @@ namespace test_cases
TEST_CHECK_EQUAL(b.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
PackageDepSpec c("foo/bar:baz", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(c, "foo/bar:baz");
TEST_CHECK_STRINGIFY_EQUAL(*c.package_ptr(), "foo/bar");
TEST_CHECK(c.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*c.slot_ptr(), "baz");
TEST_CHECK(! c.version_requirements_ptr());
PackageDepSpec d("=foo/bar-1.2*:1.2.1", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(d, "=foo/bar-1.2*:1.2.1");
TEST_CHECK_STRINGIFY_EQUAL(*d.package_ptr(), "foo/bar");
TEST_CHECK(d.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*d.slot_ptr(), "1.2.1");
@@ -112,29 +116,35 @@ namespace test_cases
TEST_CHECK_EQUAL(d.version_requirements_ptr()->begin()->version_operator, vo_equal_star);
PackageDepSpec e("foo/bar:1.2.1", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(e, "foo/bar:1.2.1");
TEST_CHECK_STRINGIFY_EQUAL(*e.package_ptr(), "foo/bar");
TEST_CHECK(e.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*e.slot_ptr(), "1.2.1");
TEST_CHECK(! e.version_requirements_ptr());
PackageDepSpec f("foo/bar:0", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(f, "foo/bar:0");
TEST_CHECK_STRINGIFY_EQUAL(*f.package_ptr(), "foo/bar");
TEST_CHECK(f.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*f.slot_ptr(), "0");
TEST_CHECK(! f.version_requirements_ptr());
PackageDepSpec g("foo/bar-100dpi", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(g, "foo/bar-100dpi");
TEST_CHECK_STRINGIFY_EQUAL(*g.package_ptr(), "foo/bar-100dpi");
PackageDepSpec h(">=foo/bar-100dpi-1.23", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(h, ">=foo/bar-100dpi-1.23");
TEST_CHECK_STRINGIFY_EQUAL(*h.package_ptr(), "foo/bar-100dpi");
TEST_CHECK(h.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(h.version_requirements_ptr()->begin()->version_spec, "1.23");
TEST_CHECK_EQUAL(h.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
TEST_CHECK_THROWS(PackageDepSpec("", pds_pm_permissive), PackageDepSpecError);
+ TEST_CHECK_THROWS(PackageDepSpec("=foo/bar-1.2[=1.3]", pds_pm_permissive), PackageDepSpecError);
PackageDepSpec i("foo/bar[one][-two]", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(i, "foo/bar[one][-two]");
TEST_CHECK_STRINGIFY_EQUAL(*i.package_ptr(), "foo/bar");
TEST_CHECK(! i.version_requirements_ptr());
TEST_CHECK(! i.repository_ptr());
@@ -151,17 +161,101 @@ namespace test_cases
TEST_CHECK(i.use_requirements_ptr()->state(UseFlagName("moo")) == use_unspecified);
PackageDepSpec j("=foo/bar-scm-r3", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(j, "=foo/bar-scm-r3");
TEST_CHECK_STRINGIFY_EQUAL(*j.package_ptr(), "foo/bar");
TEST_CHECK(j.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(j.version_requirements_ptr()->begin()->version_spec, "scm-r3");
TEST_CHECK_EQUAL(j.version_requirements_ptr()->begin()->version_operator, vo_equal);
PackageDepSpec k("=foo/bar-scm", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(k, "=foo/bar-scm");
TEST_CHECK_STRINGIFY_EQUAL(*k.package_ptr(), "foo/bar");
TEST_CHECK(k.version_requirements_ptr());
TEST_CHECK_STRINGIFY_EQUAL(k.version_requirements_ptr()->begin()->version_spec, "scm");
TEST_CHECK_EQUAL(k.version_requirements_ptr()->begin()->version_operator, vo_equal);
+
+ PackageDepSpec l("foo/bar[one][-two][>=1.2&<2.0]", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(l, "foo/bar[>=1.2&<2.0][one][-two]");
+ TEST_CHECK_STRINGIFY_EQUAL(*l.package_ptr(), "foo/bar");
+ TEST_CHECK(l.version_requirements_ptr());
+ TEST_CHECK(! l.repository_ptr());
+ TEST_CHECK_STRINGIFY_EQUAL(l.version_requirements_ptr()->begin()->version_spec, "1.2");
+ TEST_CHECK_EQUAL(l.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
+ TEST_CHECK_STRINGIFY_EQUAL(next(l.version_requirements_ptr()->begin())->version_spec, "2.0");
+ TEST_CHECK_EQUAL(next(l.version_requirements_ptr()->begin())->version_operator, vo_less);
+ TEST_CHECK(! l.slot_ptr());
+ TEST_CHECK(l.use_requirements_ptr());
+ TEST_CHECK(l.use_requirements_ptr()->find(UseFlagName("one")) !=
+ l.use_requirements_ptr()->end());
+ TEST_CHECK(l.use_requirements_ptr()->find(UseFlagName("two")) !=
+ l.use_requirements_ptr()->end());
+ TEST_CHECK(l.use_requirements_ptr()->find(UseFlagName("three")) ==
+ l.use_requirements_ptr()->end());
+ TEST_CHECK(l.use_requirements_ptr()->state(UseFlagName("one")) == use_enabled);
+ TEST_CHECK(l.use_requirements_ptr()->state(UseFlagName("two")) == use_disabled);
+ TEST_CHECK(l.use_requirements_ptr()->state(UseFlagName("moo")) == use_unspecified);
+
+ PackageDepSpec m("foo/bar[=1.2|=1.3*|~1.4]", pds_pm_permissive);
+ TEST_CHECK_STRINGIFY_EQUAL(m, "foo/bar[=1.2|=1.3*|~1.4]");
+ TEST_CHECK_STRINGIFY_EQUAL(*m.package_ptr(), "foo/bar");
+ TEST_CHECK(m.version_requirements_ptr());
+ TEST_CHECK(! m.repository_ptr());
+ TEST_CHECK_STRINGIFY_EQUAL(m.version_requirements_ptr()->begin()->version_spec, "1.2");
+ TEST_CHECK_EQUAL(m.version_requirements_ptr()->begin()->version_operator, vo_equal);
+ TEST_CHECK_STRINGIFY_EQUAL(next(m.version_requirements_ptr()->begin())->version_spec, "1.3");
+ TEST_CHECK_EQUAL(next(m.version_requirements_ptr()->begin())->version_operator, vo_equal_star);
+ TEST_CHECK_STRINGIFY_EQUAL(next(next(m.version_requirements_ptr()->begin()))->version_spec, "1.4");
+ TEST_CHECK_EQUAL(next(next(m.version_requirements_ptr()->begin()))->version_operator, vo_tilde);
+ TEST_CHECK(! m.slot_ptr());
}
} test_package_dep_spec;
+
+ struct PackageDepSpecUnspecificTest : TestCase
+ {
+ PackageDepSpecUnspecificTest() : TestCase("package dep spec unspecific") { }
+
+ void run()
+ {
+ PackageDepSpec a("*/*", pds_pm_unspecific);
+ TEST_CHECK_STRINGIFY_EQUAL(a, "*/*");
+ TEST_CHECK(! a.package_ptr());
+ TEST_CHECK(! a.package_name_part_ptr());
+ TEST_CHECK(! a.category_name_part_ptr());
+
+ PackageDepSpec b("foo/*", pds_pm_unspecific);
+ TEST_CHECK_STRINGIFY_EQUAL(b, "foo/*");
+ TEST_CHECK(! b.package_ptr());
+ TEST_CHECK(! b.package_name_part_ptr());
+ TEST_CHECK(b.category_name_part_ptr());
+ TEST_CHECK_EQUAL(*b.category_name_part_ptr(), CategoryNamePart("foo"));
+
+ PackageDepSpec c("*/foo", pds_pm_unspecific);
+ TEST_CHECK_STRINGIFY_EQUAL(c, "*/foo");
+ TEST_CHECK(! c.package_ptr());
+ TEST_CHECK(c.package_name_part_ptr());
+ TEST_CHECK_EQUAL(*c.package_name_part_ptr(), PackageNamePart("foo"));
+ TEST_CHECK(! c.category_name_part_ptr());
+
+ PackageDepSpec d("~*/*-0", pds_pm_unspecific);
+ TEST_CHECK_STRINGIFY_EQUAL(d, "~*/*-0");
+ TEST_CHECK(! d.package_ptr());
+ TEST_CHECK(! d.package_name_part_ptr());
+ TEST_CHECK(! d.category_name_part_ptr());
+
+ PackageDepSpec e(">=foo/*-1.23", pds_pm_unspecific);
+ TEST_CHECK_STRINGIFY_EQUAL(e, ">=foo/*-1.23");
+ TEST_CHECK(! e.package_ptr());
+ TEST_CHECK(! e.package_name_part_ptr());
+ TEST_CHECK(e.category_name_part_ptr());
+ TEST_CHECK_EQUAL(*e.category_name_part_ptr(), CategoryNamePart("foo"));
+
+ PackageDepSpec f("=*/foo-1*", pds_pm_unspecific);
+ TEST_CHECK_STRINGIFY_EQUAL(f, "=*/foo-1*");
+ TEST_CHECK(! f.package_ptr());
+ TEST_CHECK(f.package_name_part_ptr());
+ TEST_CHECK_EQUAL(*f.package_name_part_ptr(), PackageNamePart("foo"));
+ TEST_CHECK(! f.category_name_part_ptr());
+ }
+ } test_package_dep_spec_unspecific;
}
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 5a1f210..bfb8026 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -189,7 +189,7 @@ namespace
}
else if ("?" == tokens.at(0))
{
- std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(tokens.at(1), pds_pm_unspecific));
+ std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(tokens.at(1), params.parse_mode));
if (params.tag)
spec->set_tag(params.tag);
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 6d53c55..c87fccb 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -131,7 +131,7 @@ InstallTask::add_target(const std::string & target)
if (std::string::npos != target.find('/'))
_imp->targets->add_child(PortageDepParser::parse(target, PortageDepParser::Policy::text_is_package_dep_spec(
- true, pds_pm_unspecific)));
+ true, pds_pm_permissive)));
else
{
QualifiedPackageName q(_imp->env->package_database()->fetch_unique_qualified_package_name(
@@ -466,7 +466,7 @@ InstallTask::execute()
{
if (_imp->add_to_world_spec)
_imp->env->add_appropriate_to_world(PortageDepParser::parse_depend(
- *_imp->add_to_world_spec, pds_pm_unspecific), &w);
+ *_imp->add_to_world_spec, pds_pm_permissive), &w);
else
_imp->env->add_appropriate_to_world(_imp->targets, &w);
}
diff --git a/paludis/tasks/uninstall_task.cc b/paludis/tasks/uninstall_task.cc
index 89f17f8..50a7506 100644
--- a/paludis/tasks/uninstall_task.cc
+++ b/paludis/tasks/uninstall_task.cc
@@ -105,7 +105,7 @@ UninstallTask::add_target(const std::string & target)
throw HadBothPackageAndSetTargets();
_imp->had_package_targets = true;
- _imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(target, pds_pm_unspecific)));
+ _imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(target, pds_pm_permissive)));
}
else
try
@@ -123,7 +123,7 @@ UninstallTask::add_target(const std::string & target)
DepSpecFlattener f(_imp->env, 0, spec);
for (DepSpecFlattener::Iterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
_imp->targets.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(
- stringify((*i)->text()), pds_pm_unspecific)));
+ stringify((*i)->text()), pds_pm_permissive)));
}
else
{
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index dd7276a..18f0a36 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -119,7 +119,7 @@ namespace
if (1 == argc)
{
rb_warn("Calling PackageDepSpec.new with one argument has been deprecated");
- p = pds_pm_unspecific;
+ p = pds_pm_permissive;
}
else
p = static_cast<PackageDepSpecParseMode>(NUM2INT(argv[1]));
@@ -412,7 +412,7 @@ paludis::ruby::value_to_package_dep_spec(VALUE v)
if (T_STRING == TYPE(v))
{
rb_warn("Calling PackageDepSpec.new with one argument has been deprecated");
- return std::tr1::shared_ptr<const PackageDepSpec>(new PackageDepSpec(StringValuePtr(v), pds_pm_unspecific));
+ return std::tr1::shared_ptr<const PackageDepSpec>(new PackageDepSpec(StringValuePtr(v), pds_pm_permissive));
}
else
{
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 9789c78..38bb0e0 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -230,7 +230,7 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
PackageNamePart(*CommandLine::get_instance()->begin_parameters()))))));
}
else
- spec.reset(new PackageDepSpec(*CommandLine::get_instance()->begin_parameters(), pds_pm_unspecific));
+ spec.reset(new PackageDepSpec(*CommandLine::get_instance()->begin_parameters(), pds_pm_permissive));
}
catch (const AmbiguousPackageNameError & e)
{
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index d383441..c9c40c2 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -78,7 +78,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
env.package_database()->fetch_unique_qualified_package_name(PackageNamePart(*p)))))),
env.default_destinations());
else
- d.add(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(*p, pds_pm_unspecific)),
+ d.add(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(*p, pds_pm_permissive)),
env.default_destinations());
}
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index 0c42697..68b70ad 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -62,7 +62,7 @@ BinutilsStage::build(const StageOptions &) const
Context context("When building BinutilsStage:");
std::tr1::shared_ptr<PackageDepSpec> binutils(new PackageDepSpec(TargetConfig::get_instance()->binutils(),
- pds_pm_unspecific));
+ pds_pm_permissive));
_env->clear_forced_use();
@@ -73,7 +73,7 @@ bool
BinutilsStage::is_rebuild() const
{
return (! _env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->binutils(), pds_pm_unspecific)) &
+ query::Matches(PackageDepSpec(TargetConfig::get_instance()->binutils(), pds_pm_permissive)) &
query::InstalledAtRoot(_env->root()),
qo_whatever)->empty());
}
@@ -84,7 +84,7 @@ KernelHeadersStage::build(const StageOptions &) const
Context context("When building KernelHeadersStage:");
std::tr1::shared_ptr<PackageDepSpec> headers(new PackageDepSpec(TargetConfig::get_instance()->headers(),
- pds_pm_unspecific));
+ pds_pm_permissive));
_env->clear_forced_use();
@@ -97,7 +97,7 @@ bool
KernelHeadersStage::is_rebuild() const
{
return (! _env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->headers(), pds_pm_unspecific)) &
+ query::Matches(PackageDepSpec(TargetConfig::get_instance()->headers(), pds_pm_permissive)) &
query::InstalledAtRoot(_env->root()),
qo_whatever)->empty());
}
@@ -108,7 +108,7 @@ MinimalStage::build(const StageOptions &) const
Context context("When executing MinimalStage:");
std::tr1::shared_ptr<PackageDepSpec> gcc(new PackageDepSpec(TargetConfig::get_instance()->gcc(),
- pds_pm_unspecific));
+ pds_pm_permissive));
_env->clear_forced_use();
@@ -129,7 +129,7 @@ bool
MinimalStage::is_rebuild() const
{
return (! _env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->gcc(), pds_pm_unspecific)) &
+ query::Matches(PackageDepSpec(TargetConfig::get_instance()->gcc(), pds_pm_permissive)) &
query::InstalledAtRoot(_env->root()),
qo_whatever)->empty());
}
@@ -140,7 +140,7 @@ LibCStage::build(const StageOptions &) const
Context context("When building LibCStage:");
std::tr1::shared_ptr<PackageDepSpec> libc(new PackageDepSpec(TargetConfig::get_instance()->libc(),
- pds_pm_unspecific));
+ pds_pm_permissive));
_env->clear_forced_use();
@@ -151,7 +151,7 @@ bool
LibCStage::is_rebuild() const
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> c(_env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->libc(), pds_pm_unspecific)) &
+ query::Matches(PackageDepSpec(TargetConfig::get_instance()->libc(), pds_pm_permissive)) &
query::InstalledAtRoot(_env->root()),
qo_whatever));
@@ -167,7 +167,7 @@ FullStage::build(const StageOptions &) const
Context context("When building FullStage:");
std::tr1::shared_ptr<PackageDepSpec> gcc(new PackageDepSpec(TargetConfig::get_instance()->gcc(),
- pds_pm_unspecific));
+ pds_pm_permissive));
_env->clear_forced_use();
@@ -185,7 +185,7 @@ bool
FullStage::is_rebuild() const
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> c(_env->package_database()->query(
- query::Matches(PackageDepSpec(TargetConfig::get_instance()->gcc(), pds_pm_unspecific)) &
+ query::Matches(PackageDepSpec(TargetConfig::get_instance()->gcc(), pds_pm_permissive)) &
query::InstalledAtRoot(_env->root()),
qo_whatever));
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index 4284519..833f221 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -77,7 +77,7 @@ namespace
new PackageDepSpec(std::tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
env->package_database()->fetch_unique_qualified_package_name(
PackageNamePart(target))))) :
- new PackageDepSpec(target, pds_pm_unspecific));
+ new PackageDepSpec(target, pds_pm_permissive));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
entries(env->package_database()->query(query::Matches(*spec) & query::InstalledAtRoot(env->root()), qo_order_by_version));
diff --git a/src/clients/paludis/do_contents.cc b/src/clients/paludis/do_contents.cc
index 2b6fec1..f1268bb 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.cc
@@ -101,7 +101,7 @@ do_one_contents(
std::tr1::shared_ptr<PackageDepSpec> spec(std::string::npos == q.find('/') ?
new PackageDepSpec(std::tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(
env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q))))) :
- new PackageDepSpec(q, pds_pm_unspecific));
+ new PackageDepSpec(q, pds_pm_permissive));
std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
entries(env->package_database()->query(query::Matches(*spec) & query::InstalledAtRoot(
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 167e156..ef6b9ca 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -110,7 +110,7 @@ void do_one_query(
env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(q))))));
}
else
- spec.reset(new PackageDepSpec(q, pds_pm_unspecific));
+ spec.reset(new PackageDepSpec(q, pds_pm_permissive));
if (spec)
do_one_package_query(env, mask_reasons_to_explain, spec);