aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:16:20 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:16:20 +0100
commit37240c87e17d8b127ddb2480bbebf9ab4584379b (patch)
treea428a2fd2d934e2c9d5da49fb016392ed60ff496
parentbdacf3b7fe9b0b955c37d8315a6f36b76405ca82 (diff)
downloadpaludis-37240c87e17d8b127ddb2480bbebf9ab4584379b.tar.gz
paludis-37240c87e17d8b127ddb2480bbebf9ab4584379b.tar.xz
Allow from- and in- repository deps.
PackageID::repository is now PackageID::in_repository. Added PackageID::from_repository, which identifies things 'from' (as an origin) a particular repository.
-rw-r--r--paludis/dep_spec.cc52
-rw-r--r--paludis/dep_spec.hh27
2 files changed, 61 insertions, 18 deletions
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 93a5a69..b026d76 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -531,9 +531,15 @@ PackageDepSpec::slot_requirement_ptr() const
}
std::tr1::shared_ptr<const RepositoryName>
-PackageDepSpec::repository_ptr() const
+PackageDepSpec::from_repository_ptr() const
{
- return _imp->data->repository_ptr();
+ return _imp->data->from_repository_ptr();
+}
+
+std::tr1::shared_ptr<const RepositoryName>
+PackageDepSpec::in_repository_ptr() const
+{
+ return _imp->data->in_repository_ptr();
}
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements>
@@ -567,8 +573,11 @@ PackageDepSpec::without_additional_requirements() const
if (slot_requirement_ptr())
result.slot_requirement(slot_requirement_ptr());
- if (repository_ptr())
- result.repository(*repository_ptr());
+ if (from_repository_ptr())
+ result.from_repository(*from_repository_ptr());
+
+ if (in_repository_ptr())
+ result.in_repository(*in_repository_ptr());
return make_shared_ptr(new PackageDepSpec(result));
}
@@ -612,7 +621,8 @@ namespace
std::tr1::shared_ptr<VersionRequirements> version_requirements;
VersionRequirementsMode version_requirements_mode_v;
std::tr1::shared_ptr<const SlotRequirement> slot;
- std::tr1::shared_ptr<RepositoryName> repository;
+ std::tr1::shared_ptr<RepositoryName> from_repository;
+ std::tr1::shared_ptr<RepositoryName> in_repository;
std::tr1::shared_ptr<AdditionalPackageDepSpecRequirements> additional_requirements;
PartiallyMadePackageDepSpecData() :
@@ -629,7 +639,8 @@ namespace
version_requirements(other.version_requirements),
version_requirements_mode_v(other.version_requirements_mode_v),
slot(other.slot),
- repository(other.repository),
+ from_repository(other.from_repository),
+ in_repository(other.in_repository),
additional_requirements(other.additional_requirements)
{
}
@@ -684,8 +695,13 @@ namespace
if (slot_requirement_ptr())
s << stringify(*slot_requirement_ptr());
- if (repository_ptr())
- s << "::" << *repository_ptr();
+
+ if (in_repository_ptr() && from_repository_ptr())
+ s << "::" << *from_repository_ptr() << "->" << *in_repository_ptr();
+ else if (in_repository_ptr())
+ s << "::" << *in_repository_ptr();
+ else if (from_repository_ptr())
+ s << "::" << *from_repository_ptr() << "->";
if (version_requirements_ptr())
{
@@ -777,9 +793,14 @@ namespace
return slot;
}
- virtual std::tr1::shared_ptr<const RepositoryName> repository_ptr() const
+ virtual std::tr1::shared_ptr<const RepositoryName> from_repository_ptr() const
+ {
+ return from_repository;
+ }
+
+ virtual std::tr1::shared_ptr<const RepositoryName> in_repository_ptr() const
{
- return repository;
+ return in_repository;
}
virtual std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const
@@ -837,9 +858,16 @@ PartiallyMadePackageDepSpec::slot_requirement(const std::tr1::shared_ptr<const S
}
PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::repository(const RepositoryName & repo)
+PartiallyMadePackageDepSpec::from_repository(const RepositoryName & repo)
+{
+ _imp->data->from_repository.reset(new RepositoryName(repo));
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::in_repository(const RepositoryName & repo)
{
- _imp->data->repository.reset(new RepositoryName(repo));
+ _imp->data->in_repository.reset(new RepositoryName(repo));
return *this;
}
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 529d099..3b370fc 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -324,9 +324,14 @@ namespace paludis
PartiallyMadePackageDepSpec & slot_requirement(const std::tr1::shared_ptr<const SlotRequirement> &);
/**
- * Set our repository requirements, return ourself.
+ * Set our in-repository requirements, return ourself.
*/
- PartiallyMadePackageDepSpec & repository(const RepositoryName &);
+ PartiallyMadePackageDepSpec & in_repository(const RepositoryName &);
+
+ /**
+ * Set our from-repository requirements, return ourself.
+ */
+ PartiallyMadePackageDepSpec & from_repository(const RepositoryName &);
/**
* Set our package name part requirements, return ourself.
@@ -446,9 +451,14 @@ namespace paludis
std::tr1::shared_ptr<const SlotRequirement> slot_requirement_ptr() const;
/**
- * Fetch the repo name (may be a zero pointer).
+ * Fetch the in-repo name (may be a zero pointer).
*/
- std::tr1::shared_ptr<const RepositoryName> repository_ptr() const;
+ std::tr1::shared_ptr<const RepositoryName> in_repository_ptr() const;
+
+ /**
+ * Fetch the from-repo name (may be a zero pointer).
+ */
+ std::tr1::shared_ptr<const RepositoryName> from_repository_ptr() const;
/**
* Fetch any additional requirements (may be a zero pointer).
@@ -525,9 +535,14 @@ namespace paludis
virtual std::tr1::shared_ptr<const SlotRequirement> slot_requirement_ptr() const = 0;
/**
- * Fetch the repo name (may be a zero pointer).
+ * Fetch the in-repo name (may be a zero pointer).
+ */
+ virtual std::tr1::shared_ptr<const RepositoryName> in_repository_ptr() const = 0;
+
+ /**
+ * Fetch the from-repo name (may be a zero pointer).
*/
- virtual std::tr1::shared_ptr<const RepositoryName> repository_ptr() const = 0;
+ virtual std::tr1::shared_ptr<const RepositoryName> from_repository_ptr() const = 0;
/**
* Fetch the additional requirements (may be a zero pointer).