aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-11 08:06:36 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-11 08:06:36 +0000
commit8b015193e2fe1de6e9a09ba2178336c1309e83d7 (patch)
tree4876cf8e740695a005526024990e58a8b44a376e
parentd6908b44d6436767ee23df69bbe1aa6da7c04d06 (diff)
downloadpaludis-8b015193e2fe1de6e9a09ba2178336c1309e83d7.tar.gz
paludis-8b015193e2fe1de6e9a09ba2178336c1309e83d7.tar.xz
Support ranged dep atoms
-rw-r--r--paludis/dep_atom.cc64
-rw-r--r--paludis/dep_atom.hh18
-rw-r--r--paludis/dep_atom_TEST.cc42
-rw-r--r--paludis/environment.cc2
-rw-r--r--paludis/files.m41
-rw-r--r--paludis/match_package.cc9
-rw-r--r--paludis/portage_dep_parser_TEST.cc5
-rw-r--r--paludis/repositories/cran/cran_dep_parser_TEST.cc5
-rw-r--r--paludis/repositories/vdb/vdb_repository.cc3
-rw-r--r--paludis/version_requirements.cc25
-rw-r--r--paludis/version_requirements.hh35
-rw-r--r--paludis/version_requirements.sr13
-rw-r--r--src/paludis/list.cc106
-rw-r--r--src/paludis/query.cc6
14 files changed, 160 insertions, 174 deletions
diff --git a/paludis/dep_atom.cc b/paludis/dep_atom.cc
index ec820bc..95de32d 100644
--- a/paludis/dep_atom.cc
+++ b/paludis/dep_atom.cc
@@ -19,6 +19,7 @@
#include <paludis/dep_atom.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/collection_concrete.hh>
#include <list>
#include <map>
@@ -116,8 +117,7 @@ BlockDepAtom::BlockDepAtom(PackageDepAtom::ConstPointer a) :
PackageDepAtom::PackageDepAtom(const QualifiedPackageName & our_package) :
StringDepAtom(stringify(our_package)),
_package(our_package),
- _version_operator("="),
- _version_spec(0),
+ _version_requirements(0),
_slot(0),
_repository(0),
_use_requirements(0),
@@ -130,8 +130,7 @@ PackageDepAtom::PackageDepAtom(const PackageDepAtom & other) :
StringDepAtom(stringify(other)),
Visitable<PackageDepAtom, DepAtomVisitorTypes>(other),
_package(other._package),
- _version_operator(other._version_operator),
- _version_spec(other._version_spec),
+ _version_requirements(other._version_requirements),
_slot(other._slot),
_repository(other._repository),
_use_requirements(other._use_requirements),
@@ -142,8 +141,7 @@ PackageDepAtom::PackageDepAtom(const PackageDepAtom & other) :
PackageDepAtom::PackageDepAtom(const std::string & ss) :
StringDepAtom(ss),
_package(CategoryNamePart("later"), PackageNamePart("later")),
- _version_operator("="),
- _version_spec(0),
+ _version_requirements(0),
_slot(0),
_repository(0),
_use_requirements(0),
@@ -204,7 +202,7 @@ PackageDepAtom::PackageDepAtom(const std::string & ss) :
std::string::size_type p(1);
if (s.length() > 1 && std::string::npos != std::string("<>=~").find(s.at(1)))
++p;
- _version_operator = s.substr(0, p);
+ VersionOperator op(s.substr(0, p));
std::string::size_type q(p);
@@ -233,20 +231,20 @@ PackageDepAtom::PackageDepAtom(const std::string & ss) :
_package = QualifiedPackageName(s.substr(p, q - p - 1));
+ _version_requirements.assign(new VersionRequirements::Concrete);
+
if ('*' == s.at(s.length() - 1))
{
- if (_version_operator != vo_equal)
+ if (op != vo_equal)
Log::get_instance()->message(ll_qa, lc_context,
"Package dep atom '" + ss + "' uses * "
- "with operator '" + stringify(_version_operator) +
+ "with operator '" + stringify(op) +
"', pretending it uses the equals operator instead");
- _version_operator = vo_equal_star;
- _version_spec = CountedPtr<VersionSpec, count_policy::ExternalCountTag>(
- new VersionSpec(s.substr(q, s.length() - q - 1)));
+ op = vo_equal_star;
+ _version_requirements->push_back(VersionRequirement(op, VersionSpec(s.substr(q, s.length() - q - 1))));
}
else
- _version_spec = CountedPtr<VersionSpec, count_policy::ExternalCountTag>(
- new VersionSpec(s.substr(q)));
+ _version_requirements->push_back(VersionRequirement(op, VersionSpec(s.substr(q))));
}
else
_package = QualifiedPackageName(s);
@@ -276,22 +274,42 @@ paludis::operator<< (std::ostream & s, const PlainTextDepAtom & a)
std::ostream &
paludis::operator<< (std::ostream & s, const PackageDepAtom & a)
{
- if (a.version_spec_ptr())
+ if (a.version_requirements_ptr())
{
- if (a.version_operator() == vo_equal_star)
- s << "=";
- else
- s << a.version_operator();
+ bool need_comma(false);
+ 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 (r->version_operator == vo_equal_star)
+ s << "=";
+ else
+ s << r->version_operator;
+
+ need_comma = true;
+ }
}
s << a.package();
- if (a.version_spec_ptr())
+ if (a.version_requirements_ptr())
{
- s << "-" << *a.version_spec_ptr();
+ bool need_comma(false);
+ for (VersionRequirements::Iterator r(a.version_requirements_ptr()->begin()),
+ r_end(a.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ {
+ if (need_comma)
+ s << ",";
+
+ s << "-" << r->version_spec;
- if (a.version_operator() == vo_equal_star)
- s << "*";
+ if (r->version_operator == vo_equal_star)
+ s << "*";
+
+ need_comma = true;
+ }
}
if (a.slot_ptr())
diff --git a/paludis/dep_atom.hh b/paludis/dep_atom.hh
index d293648..3f799c3 100644
--- a/paludis/dep_atom.hh
+++ b/paludis/dep_atom.hh
@@ -26,6 +26,7 @@
#include <paludis/util/counted_ptr.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/visitor.hh>
+#include <paludis/version_requirements.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
@@ -321,8 +322,7 @@ namespace paludis
{
private:
QualifiedPackageName _package;
- VersionOperator _version_operator;
- CountedPtr<VersionSpec, count_policy::ExternalCountTag> _version_spec;
+ VersionRequirements::Pointer _version_requirements;
CountedPtr<SlotName, count_policy::ExternalCountTag> _slot;
CountedPtr<RepositoryName, count_policy::ExternalCountTag> _repository;
UseRequirements::Pointer _use_requirements;
@@ -360,19 +360,11 @@ namespace paludis
}
/**
- * Fetch the version operator.
+ * Fetch the version requirements (may be a zero pointer).
*/
- const VersionOperator version_operator() const
+ VersionRequirements::ConstPointer version_requirements_ptr() const
{
- return _version_operator;
- }
-
- /**
- * Fetch the version spec (may be a zero pointer).
- */
- CountedPtr<VersionSpec, count_policy::ExternalCountTag> version_spec_ptr() const
- {
- return _version_spec;
+ return _version_requirements;
}
/**
diff --git a/paludis/dep_atom_TEST.cc b/paludis/dep_atom_TEST.cc
index a472c43..27fd571 100644
--- a/paludis/dep_atom_TEST.cc
+++ b/paludis/dep_atom_TEST.cc
@@ -86,55 +86,57 @@ namespace test_cases
PackageDepAtom a("foo/bar");
TEST_CHECK_STRINGIFY_EQUAL(a.package(), "foo/bar");
TEST_CHECK(! a.slot_ptr());
- TEST_CHECK(! a.version_spec_ptr());
+ TEST_CHECK(! a.version_requirements_ptr());
PackageDepAtom b(">=foo/bar-1.2.3");
TEST_CHECK_STRINGIFY_EQUAL(b.package(), "foo/bar");
TEST_CHECK(! b.slot_ptr());
- TEST_CHECK(b.version_spec_ptr());
- TEST_CHECK_STRINGIFY_EQUAL(*b.version_spec_ptr(), "1.2.3");
- TEST_CHECK_EQUAL(b.version_operator(), vo_greater_equal);
+ TEST_CHECK(b.version_requirements_ptr());
+ TEST_CHECK_EQUAL(std::distance(b.version_requirements_ptr()->begin(),
+ b.version_requirements_ptr()->end()), 1);
+ TEST_CHECK_STRINGIFY_EQUAL(b.version_requirements_ptr()->begin()->version_spec, "1.2.3");
+ TEST_CHECK_EQUAL(b.version_requirements_ptr()->begin()->version_operator, vo_greater_equal);
PackageDepAtom c("foo/bar:baz");
TEST_CHECK_STRINGIFY_EQUAL(c.package(), "foo/bar");
TEST_CHECK(c.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*c.slot_ptr(), "baz");
- TEST_CHECK(! c.version_spec_ptr());
+ TEST_CHECK(! c.version_requirements_ptr());
PackageDepAtom d("=foo/bar-1.2*:1.2.1");
TEST_CHECK_STRINGIFY_EQUAL(d.package(), "foo/bar");
TEST_CHECK(d.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*d.slot_ptr(), "1.2.1");
- TEST_CHECK(d.version_spec_ptr());
- TEST_CHECK_STRINGIFY_EQUAL(*d.version_spec_ptr(), "1.2");
- TEST_CHECK_EQUAL(d.version_operator(), vo_equal_star);
+ TEST_CHECK(d.version_requirements_ptr());
+ TEST_CHECK_STRINGIFY_EQUAL(d.version_requirements_ptr()->begin()->version_spec, "1.2");
+ TEST_CHECK_EQUAL(d.version_requirements_ptr()->begin()->version_operator, vo_equal_star);
PackageDepAtom e("foo/bar:1.2.1");
TEST_CHECK_STRINGIFY_EQUAL(e.package(), "foo/bar");
TEST_CHECK(e.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*e.slot_ptr(), "1.2.1");
- TEST_CHECK(! e.version_spec_ptr());
+ TEST_CHECK(! e.version_requirements_ptr());
PackageDepAtom f("foo/bar:0");
TEST_CHECK_STRINGIFY_EQUAL(f.package(), "foo/bar");
TEST_CHECK(f.slot_ptr());
TEST_CHECK_STRINGIFY_EQUAL(*f.slot_ptr(), "0");
- TEST_CHECK(! f.version_spec_ptr());
+ TEST_CHECK(! f.version_requirements_ptr());
PackageDepAtom g("foo/bar-100dpi");
TEST_CHECK_STRINGIFY_EQUAL(g.package(), "foo/bar-100dpi");
PackageDepAtom h(">=foo/bar-100dpi-1.23");
TEST_CHECK_STRINGIFY_EQUAL(h.package(), "foo/bar-100dpi");
- TEST_CHECK(h.version_spec_ptr());
- TEST_CHECK_STRINGIFY_EQUAL(*h.version_spec_ptr(), "1.23");
- TEST_CHECK_EQUAL(h.version_operator(), vo_greater_equal);
+ 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(PackageDepAtom(""), PackageDepAtomError);
PackageDepAtom i("foo/bar[one][-two]");
TEST_CHECK_STRINGIFY_EQUAL(i.package(), "foo/bar");
- TEST_CHECK(! i.version_spec_ptr());
+ TEST_CHECK(! i.version_requirements_ptr());
TEST_CHECK(! i.repository_ptr());
TEST_CHECK(! i.slot_ptr());
TEST_CHECK(i.use_requirements_ptr());
@@ -150,15 +152,15 @@ namespace test_cases
PackageDepAtom j("=foo/bar-scm-r3");
TEST_CHECK_STRINGIFY_EQUAL(j.package(), "foo/bar");
- TEST_CHECK(j.version_spec_ptr());
- TEST_CHECK_STRINGIFY_EQUAL(*j.version_spec_ptr(), "scm-r3");
- TEST_CHECK_EQUAL(j.version_operator(), vo_equal);
+ 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);
PackageDepAtom k("=foo/bar-scm");
TEST_CHECK_STRINGIFY_EQUAL(k.package(), "foo/bar");
- TEST_CHECK(k.version_spec_ptr());
- TEST_CHECK_STRINGIFY_EQUAL(*k.version_spec_ptr(), "scm");
- TEST_CHECK_EQUAL(k.version_operator(), vo_equal);
+ 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);
}
} test_package_dep_atom;
}
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 8c83e71..ad02bf7 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -297,7 +297,7 @@ namespace
if (w)
w->skip_callback(a, ":slot restrictions");
}
- else if (a->version_spec_ptr())
+ else if (a->version_requirements_ptr() && ! a->version_requirements_ptr()->empty())
{
if (w)
w->skip_callback(a, "version restrictions");
diff --git a/paludis/files.m4 b/paludis/files.m4
index cd6fc06..08dac76 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -33,5 +33,6 @@ add(`repository_so_loader', `cc')
add(`syncer', `hh', `cc', `sr')
add(`version_metadata', `hh', `cc', `sr')
add(`version_operator', `hh', `cc', `test')
+add(`version_requirements', `hh', `cc', `sr')
add(`version_spec', `hh', `cc', `sr', `test')
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 013c586..5c08897 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -36,10 +36,11 @@ match_package_internals::do_match(
if (atom->package() != entry->name)
return false;
- if (atom->version_spec_ptr() && ! (((entry->version).*
- (atom->version_operator().as_version_spec_operator()))
- (*atom->version_spec_ptr())))
- return false;
+ if (atom->version_requirements_ptr())
+ for (VersionRequirements::Iterator r(atom->version_requirements_ptr()->begin()),
+ r_end(atom->version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ if (! (((entry->version).*(r->version_operator.as_version_spec_operator()))(r->version_spec)))
+ return false;
if (atom->repository_ptr())
if (*atom->repository_ptr() != entry->repository)
diff --git a/paludis/portage_dep_parser_TEST.cc b/paludis/portage_dep_parser_TEST.cc
index d375cb0..3d39b3e 100644
--- a/paludis/portage_dep_parser_TEST.cc
+++ b/paludis/portage_dep_parser_TEST.cc
@@ -92,8 +92,9 @@ namespace
*_o << "<package";
if (p->slot_ptr())
*_o << " slot=\"" << *p->slot_ptr() << "\"";
- if (p->version_spec_ptr())
- *_o << " version=\"" << p->version_operator() << *p->version_spec_ptr() << "\"";
+ if (p->version_requirements_ptr())
+ *_o << " version=\"" << p->version_requirements_ptr()->begin()->version_operator <<
+ p->version_requirements_ptr()->begin()->version_spec << "\"";
*_o << ">" << p->package() << "</package>";
}
diff --git a/paludis/repositories/cran/cran_dep_parser_TEST.cc b/paludis/repositories/cran/cran_dep_parser_TEST.cc
index 524db31..1240a68 100644
--- a/paludis/repositories/cran/cran_dep_parser_TEST.cc
+++ b/paludis/repositories/cran/cran_dep_parser_TEST.cc
@@ -90,8 +90,9 @@ namespace
*_o << "<package";
if (p->slot_ptr())
*_o << " slot=\"" << *p->slot_ptr() << "\"";
- if (p->version_spec_ptr())
- *_o << " version=\"" << p->version_operator() << *p->version_spec_ptr() << "\"";
+ if (p->version_requirements_ptr())
+ *_o << " version=\"" << p->version_requirements_ptr()->begin()->version_operator <<
+ p->version_requirements_ptr()->begin()->version_spec << "\"";
*_o << ">" << p->package() << "</package>";
}
diff --git a/paludis/repositories/vdb/vdb_repository.cc b/paludis/repositories/vdb/vdb_repository.cc
index b7d14d5..f8195d0 100644
--- a/paludis/repositories/vdb/vdb_repository.cc
+++ b/paludis/repositories/vdb/vdb_repository.cc
@@ -423,7 +423,8 @@ namespace paludis
for (DirIterator pkg_i(dir), pkg_iend ; pkg_i != pkg_iend ; ++pkg_i)
{
PackageDepAtom atom("=" + stringify(cat) + "/" + pkg_i->basename());
- entries.push_back(VDBEntry(atom.package(), *atom.version_spec_ptr()));
+ entries.push_back(VDBEntry(atom.package(),
+ atom.version_requirements_ptr()->begin()->version_spec));
}
std::sort(entries.begin(), entries.end());
diff --git a/paludis/version_requirements.cc b/paludis/version_requirements.cc
new file mode 100644
index 0000000..4d2321f
--- /dev/null
+++ b/paludis/version_requirements.cc
@@ -0,0 +1,25 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "version_requirements.hh"
+
+using namespace paludis;
+
+#include <paludis/version_requirements-sr.cc>
+
diff --git a/paludis/version_requirements.hh b/paludis/version_requirements.hh
new file mode 100644
index 0000000..a9f56cc
--- /dev/null
+++ b/paludis/version_requirements.hh
@@ -0,0 +1,35 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_HH
+#define PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_HH 1
+
+#include <paludis/util/collection.hh>
+#include <paludis/util/sr.hh>
+#include <paludis/version_operator.hh>
+#include <paludis/version_spec.hh>
+
+namespace paludis
+{
+#include <paludis/version_requirements-sr.hh>
+
+ typedef SequentialCollection<VersionRequirement> VersionRequirements;
+}
+
+#endif
diff --git a/paludis/version_requirements.sr b/paludis/version_requirements.sr
new file mode 100644
index 0000000..46644ca
--- /dev/null
+++ b/paludis/version_requirements.sr
@@ -0,0 +1,13 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+make_class_VersionRequirement()
+{
+ key version_operator VersionOperator
+ key version_spec VersionSpec
+
+ allow_named_args
+ comparison_operators "equality" "all"
+}
+
+
diff --git a/src/paludis/list.cc b/src/paludis/list.cc
index 66ade33..e426c59 100644
--- a/src/paludis/list.cc
+++ b/src/paludis/list.cc
@@ -237,110 +237,4 @@ do_list_sets()
return ret_code;
}
-namespace
-{
- /**
- * Print dependency atoms as returned by do_package_set("security").
- *
- * \ingroup grpvulnerabilitiesprinter
- */
- class VulnerabilitiesPrinter :
- public p::DepAtomVisitorTypes::ConstVisitor
- {
- private:
- unsigned _size;
-
- public:
- /**
- * Constructor.
- */
- VulnerabilitiesPrinter() :
- _size(0)
- {
- }
-
- /// \name Visit functions
- ///{
- void visit(const p::AllDepAtom * const);
-
- void visit(const p::AnyDepAtom * const);
-
- void visit(const p::UseDepAtom * const);
-
- void visit(const p::PackageDepAtom * const);
-
- void visit(const p::PlainTextDepAtom * const);
-
- void visit(const p::BlockDepAtom * const);
- ///}
-
- /**
- * Return number of visited atoms.
- */
- unsigned size() const
- {
- return _size;
- }
- };
-
- void
- VulnerabilitiesPrinter::visit(const p::AllDepAtom * const a)
- {
- std::for_each(a->begin(), a->end(), p::accept_visitor(this));
- }
-
- void
- VulnerabilitiesPrinter::visit(const p::AnyDepAtom * const a)
- {
- std::for_each(a->begin(), a->end(), p::accept_visitor(this));
- }
-
- void
- VulnerabilitiesPrinter::visit(const p::UseDepAtom * const a)
- {
- p::Log::get_instance()->message(p::ll_warning, p::lc_no_context,
- "UseDepAtom encounter in do_package_set(\"security\").");
- std::for_each(a->begin(), a->end(), p::accept_visitor(this));
- }
-
- void
- VulnerabilitiesPrinter::visit(const p::PackageDepAtom * const a)
- {
- p::QualifiedPackageName q(a->package());
-
- std::string c(p::stringify(q.category));
- if (CommandLine::get_instance()->a_category.specified())
- if (CommandLine::get_instance()->a_category.args_end() == std::find(
- CommandLine::get_instance()->a_category.args_begin(),
- CommandLine::get_instance()->a_category.args_end(),
- c))
- return;
-
- std::string p(p::stringify(q.package));
- if (CommandLine::get_instance()->a_package.specified())
- if (CommandLine::get_instance()->a_package.args_end() == std::find(
- CommandLine::get_instance()->a_package.args_begin(),
- CommandLine::get_instance()->a_package.args_end(),
- p))
- return;
-
- std::cout << "* " << colour(cl_package_name, p::stringify(q));
- if (0 != a->tag())
- std::cout << "-" << p::stringify(*a->version_spec_ptr());
- if (0 != a->tag())
- std::cout << " " << colour(cl_tag, "<" + a->tag()->short_text() + ">");
- std::cout << std::endl;
- ++_size;
- }
-
- void
- VulnerabilitiesPrinter::visit(const p::PlainTextDepAtom * const)
- {
- }
-
- void
- VulnerabilitiesPrinter::visit(const p::BlockDepAtom * const)
- {
- }
-}
diff --git a/src/paludis/query.cc b/src/paludis/query.cc
index 38f53a5..99a0752 100644
--- a/src/paludis/query.cc
+++ b/src/paludis/query.cc
@@ -62,8 +62,10 @@ void do_one_package_query(
/* match! display it. */
cout << "* " << colour(cl_package_name, entries->begin()->name);
- if (atom->version_spec_ptr())
- cout << " (" << atom->version_operator() << *atom->version_spec_ptr() << ")";
+ if (atom->version_requirements_ptr())
+ for (VersionRequirements::Iterator r(atom->version_requirements_ptr()->begin()),
+ r_end(atom->version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ cout << " (" << r->version_operator << r->version_spec << ")";
if (atom->slot_ptr())
cout << " (:" << *atom->slot_ptr() << ")";
if (atom->repository_ptr())