aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-13 12:55:34 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-13 12:55:34 +0100
commitd9c24549432889d1ab53d4f2641c9ebd45ec8335 (patch)
tree177aafc28788eb9be80f50909971d3253ee18690
parente7e7b6edd8ccb6f314cef1f6d7abf8352616b38e (diff)
downloadpaludis-d9c24549432889d1ab53d4f2641c9ebd45ec8335.tar.gz
paludis-d9c24549432889d1ab53d4f2641c9ebd45ec8335.tar.xz
More information in PretendJob
-rw-r--r--paludis/resolver/job.cc30
-rw-r--r--paludis/resolver/job.hh6
-rw-r--r--paludis/resolver/orderer.cc4
3 files changed, 33 insertions, 7 deletions
diff --git a/paludis/resolver/job.cc b/paludis/resolver/job.cc
index 9ada001..11b70fb 100644
--- a/paludis/resolver/job.cc
+++ b/paludis/resolver/job.cc
@@ -38,16 +38,20 @@ namespace paludis
struct Imp<PretendJob>
{
const PackageDepSpec origin_id_spec;
+ const RepositoryName destination_repository_name;
+ const DestinationType destination_type;
- Imp(const PackageDepSpec & o) :
- origin_id_spec(o)
+ Imp(const PackageDepSpec & o, const RepositoryName & r, const DestinationType t) :
+ origin_id_spec(o),
+ destination_repository_name(r),
+ destination_type(t)
{
}
};
}
-PretendJob::PretendJob(const PackageDepSpec & o) :
- Pimp<PretendJob>(o)
+PretendJob::PretendJob(const PackageDepSpec & o, const RepositoryName & r, const DestinationType t) :
+ Pimp<PretendJob>(o, r, t)
{
}
@@ -61,13 +65,27 @@ PretendJob::origin_id_spec() const
return _imp->origin_id_spec;
}
+const RepositoryName
+PretendJob::destination_repository_name() const
+{
+ return _imp->destination_repository_name;
+}
+
+DestinationType
+PretendJob::destination_type() const
+{
+ return _imp->destination_type;
+}
+
const std::shared_ptr<PretendJob>
PretendJob::deserialise(Deserialisation & d)
{
Deserialisator v(d, "PretendJob");
return std::make_shared<PretendJob>(
parse_user_package_dep_spec(v.member<std::string>("origin_id_spec"),
- d.deserialiser().environment(), { updso_no_disambiguation })
+ d.deserialiser().environment(), { updso_no_disambiguation }),
+ RepositoryName(v.member<std::string>("destination_repository_name")),
+ destringify<DestinationType>(v.member<std::string>("destination_type"))
);
}
@@ -76,6 +94,8 @@ PretendJob::serialise(Serialiser & s) const
{
s.object("PretendJob")
.member(SerialiserFlags<>(), "origin_id_spec", stringify(origin_id_spec()))
+ .member(SerialiserFlags<>(), "destination_type", stringify(destination_type()))
+ .member(SerialiserFlags<>(), "destination_repository_name", stringify(destination_repository_name()))
;
}
diff --git a/paludis/resolver/job.hh b/paludis/resolver/job.hh
index 0c8e430..a9ad6d9 100644
--- a/paludis/resolver/job.hh
+++ b/paludis/resolver/job.hh
@@ -41,11 +41,15 @@ namespace paludis
{
public:
PretendJob(
- const PackageDepSpec &
+ const PackageDepSpec &,
+ const RepositoryName &,
+ const DestinationType
);
~PretendJob();
const PackageDepSpec origin_id_spec() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const RepositoryName destination_repository_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ DestinationType destination_type() const PALUDIS_ATTRIBUTE((warn_unused_result));
static const std::shared_ptr<PretendJob> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 34c97cd..5982901 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -808,7 +808,9 @@ namespace
throw InternalError(PALUDIS_HERE, "haven't scheduled the fetch for " + stringify(index.resolvent()) + " yet");
resolved->job_lists()->pretend_job_list()->append(std::make_shared<PretendJob>(
- changes_to_make_decision.origin_id()->uniquely_identifying_spec()));
+ changes_to_make_decision.origin_id()->uniquely_identifying_spec(),
+ changes_to_make_decision.destination()->repository(),
+ changes_to_make_decision.resolvent().destination_type()));
const std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
requirements->push_back(make_named_values<JobRequirement>(