aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-05 14:42:57 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-05 14:42:57 +0000
commit816a31996697da580a8b1dde7c538c531f21afc9 (patch)
treeca0ab515641feadcafa857abd75d4f71dd9b6894
parent48b9d9508ad9944d63c7369d153ad4d842721a1b (diff)
downloadpaludis-816a31996697da580a8b1dde7c538c531f21afc9.tar.gz
paludis-816a31996697da580a8b1dde7c538c531f21afc9.tar.xz
Interface tidyup
-rw-r--r--paludis/dep_list.cc4
-rw-r--r--paludis/environment.cc2
-rw-r--r--paludis/fake_repository.cc62
-rw-r--r--paludis/fake_repository.hh25
-rw-r--r--paludis/package_database.cc26
-rw-r--r--paludis/package_database.hh5
-rw-r--r--paludis/package_database_TEST.cc42
-rw-r--r--paludis/portage_repository.cc100
-rw-r--r--paludis/portage_repository.hh18
-rw-r--r--paludis/repository.hh97
-rw-r--r--paludis/vdb_repository.cc57
-rw-r--r--paludis/vdb_repository.hh18
-rw-r--r--paludis/vdb_repository_TEST.cc4
13 files changed, 187 insertions, 273 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index c6aeb08..d39221f 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -331,7 +331,7 @@ DepList::visit(const PackageDepAtom * const p)
Context context("When resolving package dependency '" + stringify(*p) + "':");
PackageDatabaseEntryCollection::ConstPointer installed(
- _imp->environment->package_database()->query(p, is_installed_only));
+ _imp->environment->package_database()->query(*p, is_installed_only));
/* are we already on the merge list? */
{
@@ -376,7 +376,7 @@ DepList::visit(const PackageDepAtom * const p)
VersionMetadata::ConstPointer metadata(0);
PackageDatabaseEntryCollection::Pointer matches(0);
- matches = _imp->environment->package_database()->query(p, is_uninstalled_only);
+ matches = _imp->environment->package_database()->query(*p, is_uninstalled_only);
for (PackageDatabaseEntryCollection::ReverseIterator e(matches->rbegin()),
e_end(matches->rend()) ; e != e_end ; ++e)
{
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 01e9517..0fe8d6e 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -331,7 +331,7 @@ Environment::add_appropriate_to_world(DepAtom::ConstPointer a) const
for (std::list<const PackageDepAtom *>::const_iterator i(w.items.begin()),
i_end(w.items.end()) ; i != i_end ; ++i)
{
- if (! package_database()->query(*i, is_installed_only)->empty())
+ if (! package_database()->query(**i, is_installed_only)->empty())
Log::get_instance()->message(ll_debug, "Not adding '" + stringify(**i) +
"' to world, because it is already installed");
else
diff --git a/paludis/fake_repository.cc b/paludis/fake_repository.cc
index b862fa0..4b4e9a5 100644
--- a/paludis/fake_repository.cc
+++ b/paludis/fake_repository.cc
@@ -84,12 +84,11 @@ FakeRepository::do_has_category_named(const CategoryNamePart & c) const
}
bool
-FakeRepository::do_has_package_named(const CategoryNamePart & c,
- const PackageNamePart & p) const
+FakeRepository::do_has_package_named(const QualifiedPackageName & q) const
{
- return has_category_named(c) &&
- (_imp->package_names.find(c)->second->end() !=
- _imp->package_names.find(c)->second->find(p));
+ return has_category_named(q.get<qpn_category>()) &&
+ (_imp->package_names.find(q.get<qpn_category>())->second->end() !=
+ _imp->package_names.find(q.get<qpn_category>())->second->find(q.get<qpn_package>()));
}
CategoryNamePartCollection::ConstPointer
@@ -107,7 +106,7 @@ FakeRepository::do_package_names(const CategoryNamePart & c) const
PackageNamePartCollection::Iterator p(_imp->package_names.find(c)->second->begin()),
p_end(_imp->package_names.find(c)->second->end());
for ( ; p != p_end ; ++p)
- result->insert(QualifiedPackageName(c, *p));
+ result->insert(c + *p);
return result;
}
@@ -116,21 +115,20 @@ FakeRepository::do_version_specs(const QualifiedPackageName & n) const
{
if (! has_category_named(n.get<qpn_category>()))
throw InternalError(PALUDIS_HERE, "no category");
- if (! has_package_named(n.get<qpn_category>(), n.get<qpn_package>()))
+ if (! has_package_named(n))
throw InternalError(PALUDIS_HERE, "no package");
return _imp->versions.find(n)->second;
}
bool
-FakeRepository::do_has_version(const CategoryNamePart & c,
- const PackageNamePart & p, const VersionSpec & v) const
+FakeRepository::do_has_version(const QualifiedPackageName & q, const VersionSpec & v) const
{
- if (! has_category_named(c))
+ if (! has_category_named(q.get<qpn_category>()))
throw InternalError(PALUDIS_HERE, "no category");
- if (! has_package_named(c, p))
+ if (! has_package_named(q))
throw InternalError(PALUDIS_HERE, "no package");
- return _imp->versions.find(QualifiedPackageName(c, p))->second->find(v) !=
- _imp->versions.find(QualifiedPackageName(c, p))->second->end();
+ return _imp->versions.find(q)->second->find(v) !=
+ _imp->versions.find(q)->second->end();
}
void
@@ -141,25 +139,22 @@ FakeRepository::add_category(const CategoryNamePart & c)
}
void
-FakeRepository::add_package(const CategoryNamePart & c, const PackageNamePart & p)
+FakeRepository::add_package(const QualifiedPackageName & q)
{
- add_category(c);
- _imp->package_names.find(c)->second->insert(p);
- _imp->versions.insert(std::make_pair(QualifiedPackageName(c, p),
- new VersionSpecCollection));
+ add_category(q.get<qpn_category>());
+ _imp->package_names.find(q.get<qpn_category>())->second->insert(q.get<qpn_package>());
+ _imp->versions.insert(std::make_pair(q, new VersionSpecCollection));
}
VersionMetadata::Pointer
-FakeRepository::add_version(const CategoryNamePart & c, const PackageNamePart & p,
- const VersionSpec & v)
+FakeRepository::add_version(const QualifiedPackageName & q, const VersionSpec & v)
{
- add_package(c, p);
- _imp->versions.find(QualifiedPackageName(c, p))->second->insert(v);
+ add_package(q);
+ _imp->versions.find(q)->second->insert(v);
_imp->metadata.insert(
- std::make_pair(stringify(c) + "/" + stringify(p) + "-" + stringify(v),
+ std::make_pair(stringify(q) + "-" + stringify(v),
VersionMetadata::Pointer(new VersionMetadata::Ebuild(PortageDepParser::parse_depend))));
- VersionMetadata::Pointer r(_imp->metadata.find(stringify(c) +
- "/" + stringify(p) + "-" + stringify(v))->second);
+ VersionMetadata::Pointer r(_imp->metadata.find(stringify(q) + "-" + stringify(v))->second);
r->set<vm_slot>(SlotName("0"));
r->set<vm_eapi>("0");
r->get_ebuild_interface()->set<evm_keywords>("test");
@@ -168,32 +163,31 @@ FakeRepository::add_version(const CategoryNamePart & c, const PackageNamePart &
VersionMetadata::ConstPointer
FakeRepository::do_version_metadata(
- const CategoryNamePart & c, const PackageNamePart & p, const VersionSpec & v) const
+ const QualifiedPackageName & q, const VersionSpec & v) const
{
- if (! has_version(c, p, v))
+ if (! has_version(q, v))
throw InternalError(PALUDIS_HERE, "no version");
- return _imp->metadata.find(stringify(c) + "/" + stringify(p) + "-" + stringify(v))->second;
+ return _imp->metadata.find(stringify(q) + "-" + stringify(v))->second;
}
Contents::ConstPointer
FakeRepository::do_contents(
- const CategoryNamePart & c, const PackageNamePart & p, const VersionSpec & v) const
+ const QualifiedPackageName & q, const VersionSpec & v) const
{
- if (! has_version(c, p, v))
+ if (! has_version(q, v))
throw InternalError(PALUDIS_HERE, "no version");
return Contents::Pointer(new Contents);
}
bool
-FakeRepository::do_query_repository_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const
+FakeRepository::do_query_repository_masks(const QualifiedPackageName &,
+ const VersionSpec &) const
{
return false;
}
bool
-FakeRepository::do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const
+FakeRepository::do_query_profile_masks(const QualifiedPackageName &, const VersionSpec &) const
{
return false;
}
diff --git a/paludis/fake_repository.hh b/paludis/fake_repository.hh
index dcdb44d..c38d44c 100644
--- a/paludis/fake_repository.hh
+++ b/paludis/fake_repository.hh
@@ -43,8 +43,7 @@ namespace paludis
protected:
virtual bool do_has_category_named(const CategoryNamePart &) const;
- virtual bool do_has_package_named(const CategoryNamePart &,
- const PackageNamePart &) const;
+ virtual bool do_has_package_named(const QualifiedPackageName &) const;
virtual CategoryNamePartCollection::ConstPointer do_category_names() const;
@@ -54,22 +53,22 @@ namespace paludis
virtual VersionSpecCollection::ConstPointer do_version_specs(
const QualifiedPackageName &) const;
- virtual bool do_has_version(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_has_version(const QualifiedPackageName &,
+ const VersionSpec &) const;
virtual VersionMetadata::ConstPointer do_version_metadata(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const;
virtual Contents::ConstPointer do_contents(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const;
- virtual bool do_query_repository_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_query_repository_masks(const QualifiedPackageName &,
+ const VersionSpec &) const;
- virtual bool do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_query_profile_masks(const QualifiedPackageName &,
+ const VersionSpec &) const;
virtual UseFlagState do_query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
@@ -115,14 +114,14 @@ namespace paludis
/**
* Add a package, and a category if necessary.
*/
- void add_package(const CategoryNamePart &, const PackageNamePart &);
+ void add_package(const QualifiedPackageName &);
/**
* Add a version, and a package and category if necessary, and set some
* default values for its metadata, and return said metadata.
*/
VersionMetadata::Pointer add_version(
- const CategoryNamePart &, const PackageNamePart &, const VersionSpec &);
+ const QualifiedPackageName &, const VersionSpec &);
/**
* Add a version, and a package and category if necessary, and set some
@@ -132,7 +131,7 @@ namespace paludis
VersionMetadata::Pointer add_version(
const std::string & c, const std::string & p, const std::string & v)
{
- return add_version(CategoryNamePart(c), PackageNamePart(p), VersionSpec(v));
+ return add_version(CategoryNamePart(c) + PackageNamePart(p), VersionSpec(v));
}
/**
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 6504614..e2e5a9b 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -127,8 +127,7 @@ PackageDatabase::fetch_metadata(const PackageDatabaseEntry & e) const
throw NoSuchPackageError(stringify(e.get<pde_name>()));
if (! rr->has_version(e.get<pde_name>(), e.get<pde_version>()))
throw NoSuchVersionError(stringify(e.get<pde_name>()), e.get<pde_version>());
- return rr->version_metadata(e.get<pde_name>().get<qpn_category>(),
- e.get<pde_name>().get<qpn_package>(), e.get<pde_version>());
+ return rr->version_metadata(e.get<pde_name>(), e.get<pde_version>());
}
Contents::ConstPointer
@@ -141,8 +140,7 @@ PackageDatabase::fetch_contents(const PackageDatabaseEntry & e) const
throw NoSuchPackageError(stringify(e.get<pde_name>()));
if (! rr->has_version(e.get<pde_name>(), e.get<pde_version>()))
throw NoSuchVersionError(stringify(e.get<pde_name>()), e.get<pde_version>());
- return rr->contents(e.get<pde_name>().get<qpn_category>(),
- e.get<pde_name>().get<qpn_package>(), e.get<pde_version>());
+ return rr->contents(e.get<pde_name>(), e.get<pde_version>());
}
Repository::ConstPointer
@@ -172,8 +170,8 @@ PackageDatabase::fetch_unique_qualified_package_name(
CategoryNamePartCollection::ConstPointer cats(r->category_names());
CategoryNamePartCollection::Iterator c(cats->begin()), c_end(cats->end());
for ( ; c != c_end ; ++c)
- if (r->has_package_named(*c, p))
- result->insert(QualifiedPackageName(*c, p));
+ if (r->has_package_named(*c + p))
+ result->insert(*c + p);
}
if (result->empty())
@@ -185,7 +183,7 @@ PackageDatabase::fetch_unique_qualified_package_name(
}
PackageDatabaseEntryCollection::Pointer
-PackageDatabase::_do_query(const PackageDepAtom * const a, const InstallState installed_state) const
+PackageDatabase::_do_query(const PackageDepAtom & a, const InstallState installed_state) const
{
PackageDatabaseEntryCollection::Pointer result(new PackageDatabaseEntryCollection);
@@ -200,18 +198,18 @@ PackageDatabase::_do_query(const PackageDepAtom * const a, const InstallState in
if ((installed_state == is_uninstalled_only) && r->installed())
continue;
- if (! r->has_category_named(a->package().get<qpn_category>()))
+ if (! r->has_category_named(a.package().get<qpn_category>()))
continue;
- if (! r->has_package_named(a->package()))
+ if (! r->has_package_named(a.package()))
continue;
- VersionSpecCollection::ConstPointer versions(r->version_specs(a->package()));
+ VersionSpecCollection::ConstPointer versions(r->version_specs(a.package()));
VersionSpecCollection::Iterator v(versions->begin()), v_end(versions->end());
for ( ; v != v_end ; ++v)
{
- PackageDatabaseEntry e(a->package(), *v, r->name());
- if (! match_package(_imp->environment, *a, e))
+ PackageDatabaseEntry e(a.package(), *v, r->name());
+ if (! match_package(_imp->environment, a, e))
continue;
result->insert(e);
@@ -222,7 +220,7 @@ PackageDatabase::_do_query(const PackageDepAtom * const a, const InstallState in
}
PackageDatabaseEntryCollection::Pointer
-PackageDatabase::query(const PackageDepAtom * const a, const InstallState s) const
+PackageDatabase::query(const PackageDepAtom & a, const InstallState s) const
{
return _do_query(a, s);
}
@@ -257,7 +255,7 @@ PackageDatabase::favourite_repository() const
PackageDatabaseEntryCollection::Pointer
PackageDatabase::query(PackageDepAtom::ConstPointer a, const InstallState s) const
{
- return _do_query(a.raw_pointer(), s);
+ return _do_query(*a.raw_pointer(), s);
}
PackageDatabase::RepositoryIterator
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index b10d0ef..f737db6 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -261,7 +261,7 @@ namespace paludis
{
private:
PackageDatabaseEntryCollection::Pointer _do_query(
- const PackageDepAtom * const a, const InstallState) const;
+ const PackageDepAtom & a, const InstallState) const;
public:
/**
@@ -315,7 +315,7 @@ namespace paludis
* Query the repository.
*/
PackageDatabaseEntryCollection::Pointer query(
- const PackageDepAtom * const a,
+ const PackageDepAtom & a,
const InstallState) const;
/**
@@ -331,7 +331,6 @@ namespace paludis
const RepositoryName & better_repository(const RepositoryName &,
const RepositoryName &) const;
-
/**
* Iterate over all of our repositories.
*/
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index a7249be..b8fd410 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -104,50 +104,50 @@ namespace test_cases
PackageDatabase & p(*e.package_database());
FakeRepository::Pointer r1(new FakeRepository(RepositoryName("repo1")));
- r1->add_version(CategoryNamePart("r1c1"), PackageNamePart("r1c1p1"), VersionSpec("1"));
- r1->add_version(CategoryNamePart("r1c1"), PackageNamePart("r1c1p2"), VersionSpec("1"));
- r1->add_version(CategoryNamePart("r1c1"), PackageNamePart("r1c1p2"), VersionSpec("2"));
- r1->add_version(CategoryNamePart("rac1"), PackageNamePart("rac1pa"), VersionSpec("1"));
- r1->add_version(CategoryNamePart("rac1"), PackageNamePart("rac1pa"), VersionSpec("2"));
+ r1->add_version("r1c1", "r1c1p1", "1");
+ r1->add_version("r1c1", "r1c1p2", "1");
+ r1->add_version("r1c1", "r1c1p2", "2");
+ r1->add_version("rac1", "rac1pa", "1");
+ r1->add_version("rac1", "rac1pa", "2");
p.add_repository(r1);
TEST_CHECK(true);
FakeRepository::Pointer r2(new FakeRepository(RepositoryName("repo2")));
- r2->add_version(CategoryNamePart("rac1"), PackageNamePart("rac1pa"), VersionSpec("1"));
- r2->add_version(CategoryNamePart("rac1"), PackageNamePart("rac1pa"), VersionSpec("3"));
+ r2->add_version("rac1", "rac1pa", "1");
+ r2->add_version("rac1", "rac1pa", "3");
p.add_repository(r2);
TEST_CHECK(true);
PackageDepAtom d1("r1c1/r1c1p1");
- const PackageDatabaseEntryCollection::Pointer q1(p.query(&d1, is_either));
+ const PackageDatabaseEntryCollection::Pointer q1(p.query(d1, is_either));
TEST_CHECK_EQUAL(q1->size(), 1);
PackageDepAtom d2("r1c1/r1c1p2");
- const PackageDatabaseEntryCollection::Pointer q2(p.query(&d2, is_either));
+ const PackageDatabaseEntryCollection::Pointer q2(p.query(d2, is_either));
TEST_CHECK_EQUAL(q2->size(), 2);
PackageDepAtom d3(">=r1c1/r1c1p2-1");
- const PackageDatabaseEntryCollection::Pointer q3(p.query(&d3, is_either));
+ const PackageDatabaseEntryCollection::Pointer q3(p.query(d3, is_either));
TEST_CHECK_EQUAL(q3->size(), 2);
PackageDepAtom d4(">=r1c1/r1c1p2-2");
- const PackageDatabaseEntryCollection::Pointer q4(p.query(&d4, is_either));
+ const PackageDatabaseEntryCollection::Pointer q4(p.query(d4, is_either));
TEST_CHECK_EQUAL(q4->size(), 1);
PackageDepAtom d5(">=r1c1/r1c1p2-3");
- const PackageDatabaseEntryCollection::Pointer q5(p.query(&d5, is_either));
+ const PackageDatabaseEntryCollection::Pointer q5(p.query(d5, is_either));
TEST_CHECK_EQUAL(q5->size(), 0);
PackageDepAtom d6("<r1c1/r1c1p2-3");
- const PackageDatabaseEntryCollection::Pointer q6(p.query(&d6, is_either));
+ const PackageDatabaseEntryCollection::Pointer q6(p.query(d6, is_either));
TEST_CHECK_EQUAL(q6->size(), 2);
PackageDepAtom d7("rac1/rac1pa");
- const PackageDatabaseEntryCollection::Pointer q7(p.query(&d7, is_either));
+ const PackageDatabaseEntryCollection::Pointer q7(p.query(d7, is_either));
TEST_CHECK_EQUAL(q7->size(), 4);
PackageDepAtom d8("foo/bar");
- const PackageDatabaseEntryCollection::Pointer q8(p.query(&d8, is_either));
+ const PackageDatabaseEntryCollection::Pointer q8(p.query(d8, is_either));
TEST_CHECK_EQUAL(q8->size(), 0);
}
} package_database_query_test;
@@ -167,16 +167,16 @@ namespace test_cases
PackageDatabase & p(*e.package_database());
FakeRepository::Pointer r1(new FakeRepository(RepositoryName("repo1")));
- r1->add_package(CategoryNamePart("cat-one"), PackageNamePart("pkg-one"));
- r1->add_package(CategoryNamePart("cat-one"), PackageNamePart("pkg-two"));
- r1->add_package(CategoryNamePart("cat-two"), PackageNamePart("pkg-two"));
- r1->add_package(CategoryNamePart("cat-two"), PackageNamePart("pkg-three"));
+ r1->add_package(CategoryNamePart("cat-one") + PackageNamePart("pkg-one"));
+ r1->add_package(CategoryNamePart("cat-one") + PackageNamePart("pkg-two"));
+ r1->add_package(CategoryNamePart("cat-two") + PackageNamePart("pkg-two"));
+ r1->add_package(CategoryNamePart("cat-two") + PackageNamePart("pkg-three"));
p.add_repository(r1);
TEST_CHECK(true);
FakeRepository::Pointer r2(new FakeRepository(RepositoryName("repo2")));
- r1->add_package(CategoryNamePart("cat-three"), PackageNamePart("pkg-three"));
- r1->add_package(CategoryNamePart("cat-three"), PackageNamePart("pkg-four"));
+ r1->add_package(CategoryNamePart("cat-three") + PackageNamePart("pkg-three"));
+ r1->add_package(CategoryNamePart("cat-three") + PackageNamePart("pkg-four"));
p.add_repository(r2);
TEST_CHECK(true);
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 6772048..17777ef 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -559,40 +559,36 @@ PortageRepository::do_has_category_named(const CategoryNamePart & c) const
}
bool
-PortageRepository::do_has_package_named(const CategoryNamePart & c,
- const PackageNamePart & p) const
+PortageRepository::do_has_package_named(const QualifiedPackageName & q) const
{
- Context context("When checking for package '" + stringify(c) + "/"
- + stringify(p) + "' in " + stringify(name()) + ":");
+ Context context("When checking for package '" + stringify(q) + "' in " +
+ stringify(name()) + ":");
need_category_names();
- if (c == CategoryNamePart("virtual"))
+ if (q.get<qpn_category>() == CategoryNamePart("virtual"))
need_virtual_names();
- CategoryMap::iterator cat_iter(
- _imp->category_names.find(c));
+ CategoryMap::iterator cat_iter(_imp->category_names.find(q.get<qpn_category>()));
if (_imp->category_names.end() == cat_iter)
return false;
- const QualifiedPackageName n(c, p);
-
if (cat_iter->second)
- return _imp->package_names.find(n) !=
+ return _imp->package_names.find(q) !=
_imp->package_names.end();
else
{
- if (_imp->package_names.find(n) !=
+ if (_imp->package_names.find(q) !=
_imp->package_names.end())
return true;
FSEntry fs(_imp->location);
- fs /= stringify(c);
- fs /= stringify(p);
+ fs /= stringify(q.get<qpn_category>());
+ fs /= stringify(q.get<qpn_package>());
if (! fs.is_directory())
return false;
- _imp->package_names.insert(std::make_pair(n, false));
+ _imp->package_names.insert(std::make_pair(q, false));
return true;
}
}
@@ -667,8 +663,7 @@ PortageRepository::do_package_names(const CategoryNamePart & c) const
try
{
- _imp->package_names.insert(std::make_pair(
- QualifiedPackageName(c, PackageNamePart(d->basename())), false));
+ _imp->package_names.insert(std::make_pair(c + PackageNamePart(d->basename()), false));
}
catch (const NameError & e)
{
@@ -705,17 +700,16 @@ PortageRepository::do_version_specs(const QualifiedPackageName & n) const
}
bool
-PortageRepository::do_has_version(const CategoryNamePart & c,
- const PackageNamePart & p, const VersionSpec & v) const
+PortageRepository::do_has_version(const QualifiedPackageName & q,
+ const VersionSpec & v) const
{
Context context("When checking for version '" + stringify(v) + "' in '"
- + stringify(c) + "/" + stringify(p) + "' in " + stringify(name()) + ":");
+ + stringify(q) + "' in " + stringify(name()) + ":");
- if (has_package_named(c, p))
+ if (has_package_named(q))
{
- need_version_names(QualifiedPackageName(c, p));
- VersionSpecCollection::Pointer vv(
- _imp->version_specs.find(QualifiedPackageName(c, p))->second);
+ need_version_names(q);
+ VersionSpecCollection::Pointer vv(_imp->version_specs.find(q)->second);
return vv->end() != vv->find(v);
}
else
@@ -832,19 +826,19 @@ PortageRepository::fetch_repo_name(const std::string & location)
VersionMetadata::ConstPointer
PortageRepository::do_version_metadata(
- const CategoryNamePart & c, const PackageNamePart & p, const VersionSpec & v) const
+ const QualifiedPackageName & q, const VersionSpec & v) const
{
if (_imp->metadata.end() != _imp->metadata.find(
- std::make_pair(QualifiedPackageName(c, p), v)))
- return _imp->metadata.find(std::make_pair(QualifiedPackageName(c, p), v))->second;
+ std::make_pair(q, v)))
+ return _imp->metadata.find(std::make_pair(q, v))->second;
- Context context("When fetching metadata for " + stringify(c) + "/" + stringify(p) +
- "-" + stringify(v));
+ Context context("When fetching metadata for '" + stringify(q) +
+ "-" + stringify(v) + "':");
- if (! has_version(c, p, v))
+ if (! has_version(q, v))
{
Log::get_instance()->message(ll_warning, "has_version failed for request for '" +
- stringify(c) + "/" + stringify(p) + "-" + stringify(v) + "' in repository '" +
+ stringify(q) + "-" + stringify(v) + "' in repository '" +
stringify(name()) + "'");
return VersionMetadata::ConstPointer(new VersionMetadata::Ebuild(
PortageDepParser::parse_depend));
@@ -853,8 +847,8 @@ PortageRepository::do_version_metadata(
VersionMetadata::Pointer result(new VersionMetadata::Ebuild(PortageDepParser::parse_depend));
FSEntry cache_file(_imp->cache);
- cache_file /= stringify(c);
- cache_file /= stringify(p) + "-" + stringify(v);
+ cache_file /= stringify(q.get<qpn_category>());
+ cache_file /= stringify(q.get<qpn_package>()) + "-" + stringify(v);
bool ok(false);
VirtualsMap::iterator vi(_imp->virtuals_map.end());
@@ -886,7 +880,9 @@ PortageRepository::do_version_metadata(
time_t cache_time(cache_file.mtime());
ok = true;
- if ((_imp->location / stringify(c) / stringify(p) / (stringify(p) + "-" + stringify(v)
+ if ((_imp->location / stringify(q.get<qpn_category>()) /
+ stringify(q.get<qpn_package>()) /
+ (stringify(q.get<qpn_package>()) + "-" + stringify(v)
+ ".ebuild")).mtime() > cache_time)
ok = false;
else
@@ -913,8 +909,7 @@ PortageRepository::do_version_metadata(
Log::get_instance()->message(ll_warning, "Couldn't read the cache file at '"
+ stringify(cache_file) + "'");
}
- else if (_imp->virtuals_map.end() != ((vi = _imp->virtuals_map.find(
- QualifiedPackageName(c, p)))))
+ else if (_imp->virtuals_map.end() != ((vi = _imp->virtuals_map.find(q))))
{
VersionMetadata::ConstPointer m(version_metadata(vi->second->package(), v));
result->set<vm_slot>(m->get<vm_slot>());
@@ -929,45 +924,46 @@ PortageRepository::do_version_metadata(
if (! ok)
{
if (_imp->cache.basename() != "empty")
- Log::get_instance()->message(ll_warning, "No usable cache entry for '" + stringify(c) + "/" +
- stringify(p) + "-" + stringify(v) + "' in '" + stringify(name()) + "'");
+ Log::get_instance()->message(ll_warning, "No usable cache entry for '" + stringify(q) +
+ "-" + stringify(v) + "' in '" + stringify(name()) + "'");
- PackageDatabaseEntry e(QualifiedPackageName(c, p), v, name());
+ PackageDatabaseEntry e(q, v, name());
EbuildMetadataCommand cmd(EbuildCommandParams::create((
param<ecpk_environment>(_imp->env),
param<ecpk_db_entry>(&e),
- param<ecpk_ebuild_dir>(_imp->location / stringify(c) / stringify(p)),
- param<ecpk_files_dir>(_imp->location / stringify(c) / stringify(p) / "files"),
+ param<ecpk_ebuild_dir>(_imp->location / stringify(q.get<qpn_category>()) /
+ stringify(q.get<qpn_package>())),
+ param<ecpk_files_dir>(_imp->location / stringify(q.get<qpn_category>()) /
+ stringify(q.get<qpn_package>()) / "files"),
param<ecpk_eclass_dir>(_imp->eclassdir),
param<ecpk_portdir>(_imp->location),
param<ecpk_distdir>(_imp->distdir)
)));
if (! cmd())
- Log::get_instance()->message(ll_warning, "No usable metadata for '" + stringify(c) + "/" +
- stringify(p) + "-" + stringify(v) + "' in '" + stringify(name()) + "'");
+ Log::get_instance()->message(ll_warning, "No usable metadata for '" + stringify(q)
+ + "-" + stringify(v) + "' in '" + stringify(name()) + "'");
if (0 == ((result = cmd.metadata())))
throw InternalError(PALUDIS_HERE, "cmd.metadata() is zero pointer???");
}
- _imp->metadata.insert(std::make_pair(std::make_pair(QualifiedPackageName(c, p), v), result));
+ _imp->metadata.insert(std::make_pair(std::make_pair(q, v), result));
return result;
}
Contents::ConstPointer
PortageRepository::do_contents(
- const CategoryNamePart &, const PackageNamePart &, const VersionSpec &) const
+ const QualifiedPackageName &, const VersionSpec &) const
{
return Contents::Pointer(new Contents);
}
bool
-PortageRepository::do_query_repository_masks(const CategoryNamePart & c,
- const PackageNamePart & p, const VersionSpec & v) const
+PortageRepository::do_query_repository_masks(const QualifiedPackageName & q, const VersionSpec & v) const
{
if (! _imp->has_repo_mask)
{
- Context context("When querying repository mask for '" + stringify(c) + "/" + stringify(p) + "-"
+ Context context("When querying repository mask for '" + stringify(q) + "-"
+ stringify(v) + "':");
FSEntry fff(_imp->location / "profiles" / "package.mask");
@@ -985,23 +981,21 @@ PortageRepository::do_query_repository_masks(const CategoryNamePart & c,
_imp->has_repo_mask = true;
}
- RepositoryMaskMap::iterator r(
- _imp->repo_mask.find(QualifiedPackageName(c, p)));
+ RepositoryMaskMap::iterator r(_imp->repo_mask.find(q));
if (_imp->repo_mask.end() == r)
return false;
else
for (IndirectIterator<std::deque<PackageDepAtom::ConstPointer>::const_iterator, const PackageDepAtom>
k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
- if (match_package(_imp->env, *k, PackageDatabaseEntry(
- QualifiedPackageName(c, p), v, name())))
+ if (match_package(_imp->env, *k, PackageDatabaseEntry(q, v, name())))
return true;
return false;
}
bool
-PortageRepository::do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const
+PortageRepository::do_query_profile_masks(const QualifiedPackageName &,
+ const VersionSpec &) const
{
return false;
}
diff --git a/paludis/portage_repository.hh b/paludis/portage_repository.hh
index dcf7074..b1c0400 100644
--- a/paludis/portage_repository.hh
+++ b/paludis/portage_repository.hh
@@ -119,8 +119,7 @@ namespace paludis
virtual bool do_has_category_named(const CategoryNamePart &) const;
- virtual bool do_has_package_named(const CategoryNamePart &,
- const PackageNamePart &) const;
+ virtual bool do_has_package_named(const QualifiedPackageName &) const;
virtual CategoryNamePartCollection::ConstPointer do_category_names() const;
@@ -130,22 +129,21 @@ namespace paludis
virtual VersionSpecCollection::ConstPointer do_version_specs(
const QualifiedPackageName &) const;
- virtual bool do_has_version(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_has_version(const QualifiedPackageName &, const VersionSpec &) const;
virtual VersionMetadata::ConstPointer do_version_metadata(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const;
virtual Contents::ConstPointer do_contents(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const;
- virtual bool do_query_repository_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_query_repository_masks(const QualifiedPackageName &,
+ const VersionSpec &) const;
- virtual bool do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_query_profile_masks(const QualifiedPackageName &,
+ const VersionSpec &) const;
virtual UseFlagState do_query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 65bb58e..dbf0b66 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -109,21 +109,21 @@ namespace paludis
* Override in descendents: fetch the metadata.
*/
virtual VersionMetadata::ConstPointer do_version_metadata(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const = 0;
/**
* Override in descendents: fetch the contents.
*/
virtual Contents::ConstPointer do_contents(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const = 0;
/**
* Override in descendents: check for a version.
*/
- virtual bool do_has_version(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const = 0;
+ virtual bool do_has_version(const QualifiedPackageName &,
+ const VersionSpec &) const = 0;
/**
* Override in descendents: fetch version specs.
@@ -145,8 +145,7 @@ namespace paludis
/**
* Override in descendents: check for a package.
*/
- virtual bool do_has_package_named(const CategoryNamePart &,
- const PackageNamePart &) const = 0;
+ virtual bool do_has_package_named(const QualifiedPackageName &) const = 0;
/**
* Override in descendents: check for a category.
@@ -156,14 +155,14 @@ namespace paludis
/**
* Override in descendents: check for a mask.
*/
- virtual bool do_query_repository_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const = 0;
+ virtual bool do_query_repository_masks(const QualifiedPackageName &,
+ const VersionSpec &) const = 0;
/**
* Override in descendents: check for a mask.
*/
- virtual bool do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const = 0;
+ virtual bool do_query_profile_masks(const QualifiedPackageName &,
+ const VersionSpec &) const = 0;
/**
* Override in descendents: get use.
@@ -244,19 +243,9 @@ namespace paludis
/**
* Do we have a package in the given category with the given name?
*/
- bool has_package_named(const CategoryNamePart & c,
- const PackageNamePart & p) const
- {
- return do_has_package_named(c, p);
- }
-
- /**
- * Do we have a package in the given category with the given name?
- * (Override for QualifiedPackageName).
- */
bool has_package_named(const QualifiedPackageName & q) const
{
- return has_package_named(q.get<qpn_category>(), q.get<qpn_package>());
+ return do_has_package_named(q);
}
/**
@@ -286,103 +275,47 @@ namespace paludis
}
/**
- * Fetch our versions (override for split name).
- */
- VersionSpecCollection::ConstPointer version_specs(
- const CategoryNamePart & c, const PackageNamePart & p) const
- {
- return version_specs(QualifiedPackageName(c, p));
- }
-
- /**
* Do we have a version spec?
*/
- bool has_version(const CategoryNamePart & c,
- const PackageNamePart & p, const VersionSpec & v) const
- {
- return do_has_version(c, p, v);
- }
-
- /**
- * Do we have a version spec? (Override for QualifiedPackageName).
- */
bool has_version(const QualifiedPackageName & q, const VersionSpec & v) const
{
- return has_version(q.get<qpn_category>(), q.get<qpn_package>(), v);
+ return do_has_version(q, v);
}
/**
* Fetch metadata.
*/
VersionMetadata::ConstPointer version_metadata(
- const CategoryNamePart & c, const PackageNamePart & p,
- const VersionSpec & v) const
- {
- return do_version_metadata(c, p, v);
- }
-
- /**
- * Fetch metadata (override for QualifiedPackageName).
- */
- VersionMetadata::ConstPointer version_metadata(
const QualifiedPackageName & q,
const VersionSpec & v) const
{
- return version_metadata(q.get<qpn_category>(), q.get<qpn_package>(), v);
+ return do_version_metadata(q, v);
}
/**
* Fetch contents.
*/
Contents::ConstPointer contents(
- const CategoryNamePart & c, const PackageNamePart & p,
- const VersionSpec & v) const
- {
- return do_contents(c, p, v);
- }
-
- /**
- * Fetch contents (override for QualifiedPackageName).
- */
- Contents::ConstPointer contents(
const QualifiedPackageName & q,
const VersionSpec & v) const
{
- return do_contents(q.get<qpn_category>(), q.get<qpn_package>(), v);
+ return do_contents(q, v);
}
/**
* Query repository masks.
*/
- bool query_repository_masks(const CategoryNamePart & c, const PackageNamePart & p,
- const VersionSpec & v) const
- {
- return do_query_repository_masks(c, p, v);
- }
-
- /**
- * Query repository masks (override for QualifiedPackageName).
- */
bool query_repository_masks(const QualifiedPackageName & q, const VersionSpec & v) const
{
- return do_query_repository_masks(q.get<qpn_category>(), q.get<qpn_package>(), v);
+ return do_query_repository_masks(q, v);
}
/**
* Query profile masks.
*/
- bool query_profile_masks(const CategoryNamePart & c, const PackageNamePart & p,
- const VersionSpec & v) const
- {
- return do_query_profile_masks(c, p, v);
- }
-
- /**
- * Query profile masks (override for QualifiedPackageName).
- */
bool query_profile_masks(const QualifiedPackageName & q, const VersionSpec & v) const
{
- return do_query_profile_masks(q.get<qpn_category>(), q.get<qpn_package>(), v);
+ return do_query_profile_masks(q, v);
}
/**
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index e1fa20c..d10c310 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -383,17 +383,16 @@ VDBRepository::do_has_category_named(const CategoryNamePart & c) const
}
bool
-VDBRepository::do_has_package_named(const CategoryNamePart & c,
- const PackageNamePart & p) const
+VDBRepository::do_has_package_named(const QualifiedPackageName & q) const
{
- Context context("When checking for package '" + stringify(c) + "/"
- + stringify(p) + "' in " + stringify(name()) + ":");
+ Context context("When checking for package '" + stringify(q) +
+ "' in " + stringify(name()) + ":");
if (! _imp->entries_valid)
_imp->load_entries();
std::pair<std::vector<VDBEntry>::const_iterator, std::vector<VDBEntry>::const_iterator>
- r(std::equal_range(_imp->entries.begin(), _imp->entries.end(), QualifiedPackageName(c, p),
+ r(std::equal_range(_imp->entries.begin(), _imp->entries.end(), q,
VDBEntry::ComparePackage()));
return r.first != r.second;
}
@@ -456,34 +455,34 @@ VDBRepository::do_version_specs(const QualifiedPackageName & n) const
}
bool
-VDBRepository::do_has_version(const CategoryNamePart & c,
- const PackageNamePart & p, const VersionSpec & v) const
+VDBRepository::do_has_version(const QualifiedPackageName & q,
+ const VersionSpec & v) const
{
Context context("When checking for version '" + stringify(v) + "' in '"
- + stringify(c) + "/" + stringify(p) + "' in " + stringify(name()) + ":");
+ + stringify(q) + "' in " + stringify(name()) + ":");
- VersionSpecCollection::ConstPointer versions(do_version_specs(QualifiedPackageName(c, p)));
+ VersionSpecCollection::ConstPointer versions(do_version_specs(q));
return versions->end() != versions->find(v);
}
VersionMetadata::ConstPointer
VDBRepository::do_version_metadata(
- const CategoryNamePart & c, const PackageNamePart & p, const VersionSpec & v) const
+ const QualifiedPackageName & q, const VersionSpec & v) const
{
- Context context("When fetching metadata for " + stringify(c) + "/" + stringify(p) +
- "-" + stringify(v));
+ Context context("When fetching metadata for '" + stringify(q) +
+ "-" + stringify(v) + "':");
if (! _imp->entries_valid)
_imp->load_entries();
std::pair<std::vector<VDBEntry>::iterator, std::vector<VDBEntry>::iterator>
r(std::equal_range(_imp->entries.begin(), _imp->entries.end(), std::make_pair(
- QualifiedPackageName(c, p), v), VDBEntry::CompareVersion()));
+ q, v), VDBEntry::CompareVersion()));
if (r.first == r.second)
{
Log::get_instance()->message(ll_warning, "version lookup failed for request for '" +
- stringify(c) + "/" + stringify(p) + "-" + stringify(v) + "' in repository '" +
+ stringify(q) + "-" + stringify(v) + "' in repository '" +
stringify(name()) + "'");
return VersionMetadata::ConstPointer(new VersionMetadata(&PortageDepParser::parse_depend));
}
@@ -497,33 +496,34 @@ VDBRepository::do_version_metadata(
Contents::ConstPointer
VDBRepository::do_contents(
- const CategoryNamePart & c, const PackageNamePart & p, const VersionSpec & v) const
+ const QualifiedPackageName & q, const VersionSpec & v) const
{
- Context context("When fetching contents for " + stringify(c) + "/" + stringify(p) +
- "-" + stringify(v));
+ Context context("When fetching contents for '" + stringify(q) +
+ "-" + stringify(v) + "':");
if (! _imp->entries_valid)
_imp->load_entries();
std::pair<std::vector<VDBEntry>::iterator, std::vector<VDBEntry>::iterator>
r(std::equal_range(_imp->entries.begin(), _imp->entries.end(), std::make_pair(
- QualifiedPackageName(c, p), v), VDBEntry::CompareVersion()));
+ q, v), VDBEntry::CompareVersion()));
if (r.first == r.second)
{
Log::get_instance()->message(ll_warning, "version lookup failed for request for '" +
- stringify(c) + "/" + stringify(p) + "-" + stringify(v) + "' in repository '" +
+ stringify(q) + "-" + stringify(v) + "' in repository '" +
stringify(name()) + "'");
return Contents::ConstPointer(new Contents);
}
Contents::Pointer result(new Contents);
- FSEntry f(_imp->location / stringify(c) / (stringify(p) + "-" + stringify(v)));
+ FSEntry f(_imp->location / stringify(q.get<qpn_category>()) /
+ (stringify(q.get<qpn_package>()) + "-" + stringify(v)));
if (! (f / "CONTENTS").is_regular_file())
{
Log::get_instance()->message(ll_warning, "CONTENTS lookup failed for request for '" +
- stringify(c + p) + "-" + stringify(v) + "' in vdb '" +
+ stringify(q) + "-" + stringify(v) + "' in vdb '" +
stringify(_imp->location) + "'");
return result;
}
@@ -546,7 +546,7 @@ VDBRepository::do_contents(
if (tokens.size() < 2)
{
Log::get_instance()->message(ll_warning, "CONTENTS for '" +
- stringify(c + p) + "-" + stringify(v) + "' in vdb '" +
+ stringify(q) + "-" + stringify(v) + "' in vdb '" +
stringify(_imp->location) + "' has broken line " +
stringify(line_number) + ", skipping");
continue;
@@ -563,7 +563,7 @@ VDBRepository::do_contents(
if (tokens.size() < 4)
{
Log::get_instance()->message(ll_warning, "CONTENTS for '" +
- stringify(c + p) + "-" + stringify(v) + "' in vdb '" +
+ stringify(q) + "-" + stringify(v) + "' in vdb '" +
stringify(_imp->location) + "' has broken sym line " +
stringify(line_number) + ", skipping");
continue;
@@ -578,21 +578,22 @@ VDBRepository::do_contents(
}
bool
-VDBRepository::do_query_repository_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const
+VDBRepository::do_query_repository_masks(const QualifiedPackageName &,
+ const VersionSpec &) const
{
return false;
}
bool
-VDBRepository::do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const
+VDBRepository::do_query_profile_masks(const QualifiedPackageName &,
+ const VersionSpec &) const
{
return false;
}
UseFlagState
-VDBRepository::do_query_use(const UseFlagName & f, const PackageDatabaseEntry * const e) const
+VDBRepository::do_query_use(const UseFlagName & f,
+ const PackageDatabaseEntry * const e) const
{
if (! _imp->entries_valid)
_imp->load_entries();
diff --git a/paludis/vdb_repository.hh b/paludis/vdb_repository.hh
index dd82ba3..927a252 100644
--- a/paludis/vdb_repository.hh
+++ b/paludis/vdb_repository.hh
@@ -90,8 +90,7 @@ namespace paludis
protected:
virtual bool do_has_category_named(const CategoryNamePart &) const;
- virtual bool do_has_package_named(const CategoryNamePart &,
- const PackageNamePart &) const;
+ virtual bool do_has_package_named(const QualifiedPackageName &) const;
virtual CategoryNamePartCollection::ConstPointer do_category_names() const;
@@ -101,22 +100,21 @@ namespace paludis
virtual VersionSpecCollection::ConstPointer do_version_specs(
const QualifiedPackageName &) const;
- virtual bool do_has_version(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_has_version(const QualifiedPackageName &, const VersionSpec &) const;
virtual VersionMetadata::ConstPointer do_version_metadata(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const;
virtual Contents::ConstPointer do_contents(
- const CategoryNamePart &, const PackageNamePart &,
+ const QualifiedPackageName &,
const VersionSpec &) const;
- virtual bool do_query_repository_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_query_repository_masks(const QualifiedPackageName &,
+ const VersionSpec &) const;
- virtual bool do_query_profile_masks(const CategoryNamePart &,
- const PackageNamePart &, const VersionSpec &) const;
+ virtual bool do_query_profile_masks(const QualifiedPackageName &,
+ const VersionSpec &) const;
virtual UseFlagState do_query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
diff --git a/paludis/vdb_repository_TEST.cc b/paludis/vdb_repository_TEST.cc
index 089aba2..ca5f5f9 100644
--- a/paludis/vdb_repository_TEST.cc
+++ b/paludis/vdb_repository_TEST.cc
@@ -96,9 +96,9 @@ namespace test_cases
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
&env, env.package_database().raw_pointer(), keys));
- PackageDatabaseEntry e1(QualifiedPackageName(CategoryNamePart("cat-one"), PackageNamePart("pkg-one")),
+ PackageDatabaseEntry e1(CategoryNamePart("cat-one") + PackageNamePart("pkg-one"),
VersionSpec("1"), RepositoryName("installed"));
- PackageDatabaseEntry e2(QualifiedPackageName(CategoryNamePart("cat-one"), PackageNamePart("pkg-neither")),
+ PackageDatabaseEntry e2(CategoryNamePart("cat-one") + PackageNamePart("pkg-neither"),
VersionSpec("1"), RepositoryName("installed"));
TEST_CHECK(repo->query_use(UseFlagName("flag1"), &e1) == use_enabled);