aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-25 20:18:12 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-25 20:18:12 +0000
commit07e5612f49c01d38e01421cc8491fbb1c0550be8 (patch)
treee3f3aeb0d84098ed7c952b69f72ca432e5e803e6
parent98abd63e73767e3b154ca73f03f5d375560fb39b (diff)
downloadpaludis-07e5612f49c01d38e01421cc8491fbb1c0550be8.tar.gz
paludis-07e5612f49c01d38e01421cc8491fbb1c0550be8.tar.xz
Allow version-restricted virtuals
-rw-r--r--paludis/repositories/portage/portage_repository.cc18
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc19
-rw-r--r--paludis/repository.sr2
3 files changed, 18 insertions, 21 deletions
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index 8d91b41..a9e5758 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -901,16 +901,9 @@ PortageRepository::virtual_packages() const
for (PortageRepositoryProfile::VirtualsIterator i(_imp->profile_ptr->begin_virtuals()),
i_end(_imp->profile_ptr->end_virtuals()) ; i != i_end ; ++i)
- {
- if (stringify(i->second->package()) != stringify(*i->second))
- Log::get_instance()->message(ll_qa, lc_context, "Stripping virtual '"
- + stringify(i->first) + "' provider '" + stringify(*i->second) + "' to '" +
- stringify(i->second->package()) + "'");
-
result->insert(RepositoryVirtualsEntry::create()
- .provided_by_name(i->second->package())
+ .provided_by_atom(i->second)
.virtual_name(i->first));
- }
Log::get_instance()->message(ll_debug, lc_context, "Loaded " + stringify(result->size()) +
" virtual packages for repository '" + stringify(name()) + "'");
@@ -922,16 +915,17 @@ VersionMetadata::ConstPointer
PortageRepository::virtual_package_version_metadata(const RepositoryVirtualsEntry & p,
const VersionSpec & v) const
{
- VersionMetadata::ConstPointer m(version_metadata(p.provided_by_name, v));
+ VersionMetadata::ConstPointer m(version_metadata(p.provided_by_atom->package(), v));
VersionMetadata::Virtual::Pointer result(new VersionMetadata::Virtual(
- PortageDepParser::parse_depend, PackageDatabaseEntry(p.provided_by_name, v, name())));
+ PortageDepParser::parse_depend, PackageDatabaseEntry(
+ p.provided_by_atom->package(), v, name())));
result->slot = m->slot;
result->license_string = m->license_string;
result->eapi = m->eapi;
result->deps = VersionMetadataDeps(&PortageDepParser::parse_depend,
- "=" + stringify(p.provided_by_name) + "-" + stringify(v),
- "=" + stringify(p.provided_by_name) + "-" + stringify(v), "");
+ "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v),
+ "=" + stringify(p.provided_by_atom->package()) + "-" + stringify(v), "");
return result;
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 8b13d83..b63af87 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -20,6 +20,7 @@
#include "virtuals_repository.hh"
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
+#include <paludis/match_package.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/fast_unique_copy.hh>
#include <paludis/util/log.hh>
@@ -96,22 +97,24 @@ VirtualsRepository::need_entries() const
for (RepositoryVirtualsInterface::VirtualsCollection::Iterator p(
pp->begin()), p_end(pp->end()) ; p != p_end ; ++p)
{
- VersionSpecCollection::ConstPointer vv((*r)->version_specs(p->provided_by_name));
+ VersionSpecCollection::ConstPointer vv((*r)->version_specs(p->provided_by_atom->package()));
/* following is debug, not warning, because of overlay style repos */
if (vv->empty())
Log::get_instance()->message(ll_debug, lc_context, "No packages matching '"
- + stringify(p->provided_by_name) + "' for virtual '"
+ + stringify(*p->provided_by_atom) + "' for virtual '"
+ stringify(p->virtual_name) + " ' in repository '"
+ stringify((*r)->name()) + "'");
for (VersionSpecCollection::Iterator v(vv->begin()), v_end(vv->end()) ;
v != v_end ; ++v)
- _imp->entries.push_back(VREntry::create()
- .virtual_name(p->virtual_name)
- .version(*v)
- .provided_by_name(p->provided_by_name)
- .provided_by_repository((*r)->name()));
+ if (match_package(_imp->env, p->provided_by_atom, PackageDatabaseEntry(
+ p->provided_by_atom->package(), *v, (*r)->name())))
+ _imp->entries.push_back(VREntry::create()
+ .virtual_name(p->virtual_name)
+ .version(*v)
+ .provided_by_name(p->provided_by_atom->package())
+ .provided_by_repository((*r)->name()));
}
}
@@ -165,7 +168,7 @@ VirtualsRepository::do_version_metadata(
p.first->provided_by_repository)->virtuals_interface->virtual_package_version_metadata(
RepositoryVirtualsEntry::create()
.virtual_name(p.first->virtual_name)
- .provided_by_name(p.first->provided_by_name), v);
+ .provided_by_atom(PackageDepAtom::Pointer(new PackageDepAtom(p.first->provided_by_name))), v);
}
bool
diff --git a/paludis/repository.sr b/paludis/repository.sr
index b3ca75d..2194ddc 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -71,7 +71,7 @@ make_class_RepositoryProvidesEntry()
make_class_RepositoryVirtualsEntry()
{
key virtual_name QualifiedPackageName
- key provided_by_name QualifiedPackageName
+ key provided_by_atom PackageDepAtom::ConstPointer
allow_named_args
comparison_operators all all