aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-23 22:51:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-23 22:51:37 +0000
commit7fde3c02941822cdfb7e160cb244a76966ac752a (patch)
treea7513d0231bec955ceb2b4aea1c8b8a9205fa9e5 /paludis/repositories/virtuals
parentc0220371b5b821fb2a01aaa983046d0a330fe0b9 (diff)
downloadpaludis-7fde3c02941822cdfb7e160cb244a76966ac752a.tar.gz
paludis-7fde3c02941822cdfb7e160cb244a76966ac752a.tar.xz
PackageID::uniquely_identifying_spec()
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/package_id.cc9
-rw-r--r--paludis/repositories/virtuals/package_id.hh1
2 files changed, 10 insertions, 0 deletions
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index e3334ccfb..58642b0bf 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -238,6 +238,15 @@ VirtualsPackageID::canonical_form(const PackageIDCanonicalForm f) const
throw InternalError(PALUDIS_HERE, "Bad PackageIDCanonicalForm");
}
+PackageDepSpec
+VirtualsPackageID::uniquely_identifying_spec() const
+{
+ return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
+ (slot_key() ? ":" + stringify(slot_key()->value()) : "") + "::" + stringify(repository()->name()) +
+ "[." + _imp->virtual_for->raw_name() + "=" + stringify(*_imp->virtual_for->value()) + "]",
+ _imp->env, UserPackageDepSpecOptions());
+}
+
const QualifiedPackageName
VirtualsPackageID::name() const
{
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index 18ff6be48..78f3ce1a7 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -85,6 +85,7 @@ namespace paludis
virtual const QualifiedPackageName name() const;
virtual const VersionSpec version() const;
virtual const std::tr1::shared_ptr<const Repository> repository() const;
+ virtual PackageDepSpec uniquely_identifying_spec() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<SlotName> > slot_key() const;
virtual const std::tr1::shared_ptr<const MetadataValueKey<std::tr1::shared_ptr<const PackageID> > > virtual_for_key() const;