aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-24 02:19:10 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-24 02:19:10 +0000
commitb78a0e97b3fdf8bc69d2991a10d97b6bec06d764 (patch)
treed1f47dc7f03b74acfd376f704edea8875db47738
parent43b687696d9ae0ba0662c6383ccd25c77e721174 (diff)
downloadpaludis-b78a0e97b3fdf8bc69d2991a10d97b6bec06d764.tar.gz
paludis-b78a0e97b3fdf8bc69d2991a10d97b6bec06d764.tar.xz
Maybe fix the virtuals + package mask issue.
-rw-r--r--paludis/environment.cc27
-rw-r--r--paludis/portage_repository.cc2
-rw-r--r--paludis/version_metadata.hh1
3 files changed, 30 insertions, 0 deletions
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 68114b1..4337cb5 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -52,6 +52,20 @@ Environment::mask_reasons(const PackageDatabaseEntry & e) const
break;
}
+ if (! metadata->get(vmk_virtual).empty())
+ {
+ QualifiedPackageName n(make_qualified_package_name(metadata->get(vmk_virtual)));
+
+ PackageDatabaseEntry ee(n, e.get<pde_version>(), e.get<pde_repository>());
+ for (VersionMetadata::KeywordIterator k(metadata->begin_keywords()),
+ k_end(metadata->end_keywords()) ; k != k_end ; ++k)
+ if (accept_keyword(*k, &ee))
+ {
+ result.reset(mr_keyword);
+ break;
+ }
+ }
+
if (! query_user_unmasks(e))
{
if (query_user_masks(e))
@@ -64,6 +78,19 @@ Environment::mask_reasons(const PackageDatabaseEntry & e) const
if (package_database()->fetch_repository(e.get<pde_repository>())->query_repository_masks(e.get<pde_name>(),
e.get<pde_version>()))
result.set(mr_repository_mask);
+
+ if (! metadata->get(vmk_virtual).empty())
+ {
+ QualifiedPackageName n(make_qualified_package_name(metadata->get(vmk_virtual)));
+
+ if (package_database()->fetch_repository(e.get<pde_repository>())->query_profile_masks(n,
+ e.get<pde_version>()))
+ result.set(mr_profile_mask);
+
+ if (package_database()->fetch_repository(e.get<pde_repository>())->query_repository_masks(n,
+ e.get<pde_version>()))
+ result.set(mr_repository_mask);
+ }
}
}
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index ad4c21e..a569666 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -450,6 +450,7 @@ PortageRepository::do_version_metadata(
std::getline(cache, line); result->set(vmk_pdepend, line);
std::getline(cache, line); result->set(vmk_provide, line);
std::getline(cache, line); result->set(vmk_eapi, line);
+ result->set(vmk_virtual, "");
}
else if (_implementation->virtuals_map.end() != ((vi = _implementation->virtuals_map.find(
QualifiedPackageName(c, p)))))
@@ -458,6 +459,7 @@ PortageRepository::do_version_metadata(
result->set(vmk_slot, m->get(vmk_slot));
result->set(vmk_keywords, m->get(vmk_keywords));
result->set(vmk_eapi, m->get(vmk_eapi));
+ result->set(vmk_virtual, stringify(vi->second->package()));
result->set(vmk_depend, "=" + stringify(vi->second->package()) + "-" + stringify(v));
}
else
diff --git a/paludis/version_metadata.hh b/paludis/version_metadata.hh
index 0c4921e..7dadb1a 100644
--- a/paludis/version_metadata.hh
+++ b/paludis/version_metadata.hh
@@ -51,6 +51,7 @@ namespace paludis
vmk_eapi, ///< EAPI
vmk_homepage, ///< HOMEPAGE
vmk_description, ///< DESCRIPTION
+ vmk_virtual, ///< Are we a virtual for something (empty is no)?
last_vmk ///< Number of items (keep at end!)
};