aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-06 13:21:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:56 +0000
commit81ef7b0468950cade215c889d47143db21720695 (patch)
tree9fe89084961f1bbf5c35619f82d802e457443b8a /paludis/resolver
parent20cc98f89f0208619fa8845d784463f03a7c9234 (diff)
downloadpaludis-81ef7b0468950cade215c889d47143db21720695.tar.gz
paludis-81ef7b0468950cade215c889d47143db21720695.tar.xz
Pass ID to match_package
Diffstat (limited to 'paludis/resolver')
-rw-r--r--paludis/resolver/allowed_to_remove_helper.cc6
-rw-r--r--paludis/resolver/always_via_binary_helper.cc6
-rw-r--r--paludis/resolver/can_use_helper.cc6
-rw-r--r--paludis/resolver/collect_depped_upon.cc13
-rw-r--r--paludis/resolver/collect_provided.cc4
-rw-r--r--paludis/resolver/confirm_helper.cc5
-rw-r--r--paludis/resolver/constraint.cc55
-rw-r--r--paludis/resolver/constraint.hh4
-rw-r--r--paludis/resolver/decider.cc43
-rw-r--r--paludis/resolver/decider.hh6
-rw-r--r--paludis/resolver/get_constraints_for_dependent_helper.cc7
-rw-r--r--paludis/resolver/get_constraints_for_purge_helper.cc7
-rw-r--r--paludis/resolver/get_constraints_for_via_binary_helper.cc4
-rw-r--r--paludis/resolver/get_initial_constraints_for_helper.cc8
-rw-r--r--paludis/resolver/get_initial_constraints_for_helper.hh4
-rw-r--r--paludis/resolver/get_resolvents_for_helper.cc7
-rw-r--r--paludis/resolver/get_resolvents_for_helper.hh3
-rw-r--r--paludis/resolver/interest_in_spec_helper.cc13
-rw-r--r--paludis/resolver/order_early_helper.cc7
-rw-r--r--paludis/resolver/reason_utils-fwd.hh6
-rw-r--r--paludis/resolver/reason_utils.cc53
-rw-r--r--paludis/resolver/remove_if_dependent_helper.cc6
-rw-r--r--paludis/resolver/resolver_functions.hh3
-rw-r--r--paludis/resolver/sanitised_dependencies.cc5
-rw-r--r--paludis/resolver/sanitised_dependencies.hh4
25 files changed, 170 insertions, 115 deletions
diff --git a/paludis/resolver/allowed_to_remove_helper.cc b/paludis/resolver/allowed_to_remove_helper.cc
index 9272e749d..69c16383d 100644
--- a/paludis/resolver/allowed_to_remove_helper.cc
+++ b/paludis/resolver/allowed_to_remove_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,6 +23,7 @@
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -38,7 +39,8 @@ namespace paludis
PackageDepSpecCollection allowed_to_remove_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ allowed_to_remove_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/always_via_binary_helper.cc b/paludis/resolver/always_via_binary_helper.cc
index 147b58c93..abe64db6f 100644
--- a/paludis/resolver/always_via_binary_helper.cc
+++ b/paludis/resolver/always_via_binary_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,6 +26,7 @@
#include <paludis/resolver/destination_utils.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -43,7 +44,8 @@ namespace paludis
PackageDepSpecCollection always_via_binary_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ always_via_binary_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/can_use_helper.cc b/paludis/resolver/can_use_helper.cc
index af5e1b046..0e4613090 100644
--- a/paludis/resolver/can_use_helper.cc
+++ b/paludis/resolver/can_use_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -20,6 +20,7 @@
#include <paludis/resolver/can_use_helper.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -36,7 +37,8 @@ namespace paludis
PackageDepSpecCollection cannot_use_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ cannot_use_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/collect_depped_upon.cc b/paludis/resolver/collect_depped_upon.cc
index 67e1cf517..fdfd572c7 100644
--- a/paludis/resolver/collect_depped_upon.cc
+++ b/paludis/resolver/collect_depped_upon.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -53,6 +53,7 @@ namespace
const std::shared_ptr<const PackageID> best_eventual(
const Environment * const env,
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const S_ & seq)
{
std::shared_ptr<const PackageID> result;
@@ -61,7 +62,7 @@ namespace
i != i_end ; ++i)
{
if ((! result) || dependent_checker_id(*i)->version() >= result->version())
- if (match_package(*env, spec, dependent_checker_id(*i), { }))
+ if (match_package(*env, spec, dependent_checker_id(*i), from_id, { }))
result = dependent_checker_id(*i);
}
@@ -108,9 +109,9 @@ namespace
if (s.spec()->slot_requirement_ptr() && simple_visitor_cast<const SlotAnyUnlockedRequirement>(
*s.spec()->slot_requirement_ptr()))
{
- auto best_eventual_id(best_eventual(env, *s.spec(), newly_available));
+ auto best_eventual_id(best_eventual(env, *s.spec(), id, newly_available));
if (! best_eventual_id)
- best_eventual_id = best_eventual(env, *s.spec(), not_changing_slots);
+ best_eventual_id = best_eventual(env, *s.spec(), id, not_changing_slots);
if (best_eventual_id && best_eventual_id->slot_key())
{
PartiallyMadePackageDepSpec part_spec(*s.spec());
@@ -119,14 +120,14 @@ namespace
}
}
- if (! match_package(*env, *spec, dependent_checker_id(*g), { }))
+ if (! match_package(*env, *spec, dependent_checker_id(*g), id, { }))
continue;
bool any(false);
for (typename C_::ConstIterator n(newly_available->begin()), n_end(newly_available->end()) ;
n != n_end ; ++n)
{
- if (match_package(*env, *spec, dependent_checker_id(*n), { }))
+ if (match_package(*env, *spec, dependent_checker_id(*n), id, { }))
{
any = true;
break;
diff --git a/paludis/resolver/collect_provided.cc b/paludis/resolver/collect_provided.cc
index 4fe17d535..a0d0235f8 100644
--- a/paludis/resolver/collect_provided.cc
+++ b/paludis/resolver/collect_provided.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -50,7 +50,7 @@ paludis::resolver::collect_provided(
v != v_end ; ++v)
{
const std::shared_ptr<const PackageIDSequence> virtuals((*env)[selection::AllVersionsUnsorted(
- generator::Matches(**v, { }))]);
+ generator::Matches(**v, id, { }))]);
std::copy(virtuals->begin(), virtuals->end(), result->inserter());
}
}
diff --git a/paludis/resolver/confirm_helper.cc b/paludis/resolver/confirm_helper.cc
index 3a531b58d..f9d646504 100644
--- a/paludis/resolver/confirm_helper.cc
+++ b/paludis/resolver/confirm_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -47,6 +47,9 @@ namespace paludis
Imp(const Environment * const e) :
env(e),
+ permit_downgrade_specs(make_null_shared_ptr()),
+ permit_old_version_specs(make_null_shared_ptr()),
+ allowed_to_break_specs(make_null_shared_ptr()),
allowed_to_break_system(false)
{
}
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index f23e187e8..7d147c870 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -147,6 +147,7 @@ Constraint::serialise(Serialiser & s) const
s.object("Constraint")
.member(SerialiserFlags<>(), "destination_type", stringify(destination_type()))
.member(SerialiserFlags<>(), "force_unable", stringify(force_unable()))
+ .member(SerialiserFlags<serialise::might_be_null>(), "from_id", from_id())
.member(SerialiserFlags<>(), "nothing_is_fine_too", nothing_is_fine_too())
.member(SerialiserFlags<serialise::might_be_null>(), "reason", reason())
.member(SerialiserFlags<>(), "spec", spec())
@@ -155,52 +156,6 @@ Constraint::serialise(Serialiser & s) const
;
}
-namespace
-{
- struct IDFinder
- {
- const std::shared_ptr<const PackageID> visit(const DependencyReason & r) const
- {
- return r.from_id();
- }
-
- const std::shared_ptr<const PackageID> visit(const SetReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const LikeOtherDestinationTypeReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const PresetReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const TargetReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const DependentReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const ViaBinaryReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const WasUsedByReason &) const
- {
- return make_null_shared_ptr();
- }
- };
-}
-
const std::shared_ptr<Constraint>
Constraint::deserialise(Deserialisation & d)
{
@@ -209,15 +164,15 @@ Constraint::deserialise(Deserialisation & d)
Deserialisator v(d, "Constraint");
const std::shared_ptr<Reason> reason(v.member<std::shared_ptr<Reason> >("reason"));
- IDFinder id_finder;
+ const std::shared_ptr<const PackageID> from_id(v.member<std::shared_ptr<const PackageID> >("from_id"));
return std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = destringify<DestinationType>(v.member<std::string>("destination_type")),
n::force_unable() = v.member<bool>("force_unable"),
+ n::from_id() = from_id,
n::nothing_is_fine_too() = v.member<bool>("nothing_is_fine_too"),
n::reason() = reason,
- n::spec() = PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
- reason->accept_returning<std::shared_ptr<const PackageID> >(id_finder)),
+ n::spec() = PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"), from_id),
n::untaken() = v.member<bool>("untaken"),
n::use_existing() = destringify<UseExisting>(v.member<std::string>("use_existing"))
));
diff --git a/paludis/resolver/constraint.hh b/paludis/resolver/constraint.hh
index 0e1aed443..7d27c7cc2 100644
--- a/paludis/resolver/constraint.hh
+++ b/paludis/resolver/constraint.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -37,6 +37,7 @@ namespace paludis
{
typedef Name<struct name_destination_type> destination_type;
typedef Name<struct name_force_unable> force_unable;
+ typedef Name<struct name_from_id> from_id;
typedef Name<struct name_nothing_is_fine_too> nothing_is_fine_too;
typedef Name<struct name_reason> reason;
typedef Name<struct name_spec> spec;
@@ -50,6 +51,7 @@ namespace paludis
{
NamedValue<n::destination_type, DestinationType> destination_type;
NamedValue<n::force_unable, bool> force_unable;
+ NamedValue<n::from_id, std::shared_ptr<const PackageID> > from_id;
NamedValue<n::nothing_is_fine_too, bool> nothing_is_fine_too;
NamedValue<n::reason, std::shared_ptr<const Reason> > reason;
NamedValue<n::spec, PackageOrBlockDepSpec> spec;
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 57a6b4b2b..c31d6671e 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -38,6 +38,7 @@
#include <paludis/resolver/accumulate_deps_and_provides.hh>
#include <paludis/resolver/why_changed_choices.hh>
#include <paludis/resolver/same_slot.hh>
+#include <paludis/resolver/reason_utils.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -577,6 +578,7 @@ Decider::_make_constraints_from_target(
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::force_unable() = false,
+ n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = existing.second,
n::reason() = reason,
n::spec() = spec,
@@ -606,6 +608,7 @@ Decider::_make_constraints_from_dependency(
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::force_unable() = false,
+ n::from_id() = dep.from_id(),
n::nothing_is_fine_too() = existing.second,
n::reason() = reason,
n::spec() = *dep.spec().if_package(),
@@ -638,11 +641,11 @@ Decider::_make_constraints_from_blocker(
break;
case bk_manual:
- force_unable = ! _already_met(spec);
+ force_unable = ! _already_met(spec, maybe_from_package_id_from_reason(reason));
break;
case bk_upgrade_blocked_before:
- nothing_is_fine_too = ! _already_met(spec);
+ nothing_is_fine_too = ! _already_met(spec, maybe_from_package_id_from_reason(reason));
break;
case last_bk:
@@ -655,6 +658,7 @@ Decider::_make_constraints_from_blocker(
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = *t,
n::force_unable() = force_unable,
+ n::from_id() = maybe_from_package_id_from_reason(reason),
n::nothing_is_fine_too() = nothing_is_fine_too,
n::reason() = reason,
n::spec() = spec,
@@ -703,13 +707,13 @@ namespace
if (constraint.spec().if_package())
{
if (! match_package_with_maybe_changes(*env, *constraint.spec().if_package(),
- changed_choices_for_constraint.get(), chosen_id, changed_choices.get(), { }))
+ changed_choices_for_constraint.get(), chosen_id, constraint.from_id(), changed_choices.get(), { }))
return false;
}
else
{
if (match_package_with_maybe_changes(*env, constraint.spec().if_block()->blocking(),
- changed_choices_for_constraint.get(), chosen_id, changed_choices.get(), { }))
+ changed_choices_for_constraint.get(), chosen_id, constraint.from_id(), changed_choices.get(), { }))
return false;
}
@@ -1177,7 +1181,7 @@ Decider::_add_dependencies_if_necessary(
}
const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
- package_id, changed_choices, our_resolution->resolvent(), *s, _already_met(s->spec())));
+ package_id, changed_choices, our_resolution->resolvent(), *s, _already_met(s->spec(), package_id)));
/* empty resolvents is always ok for blockers, since blocking on things
* that don't exist is fine */
@@ -1310,7 +1314,7 @@ Decider::find_any_score(
if (is_block)
{
const std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements })
+ generator::Matches(spec, our_id, { mpo_ignore_additional_requirements })
| filter::SupportsAction<InstallAction>() | filter::NotMasked()
)]);
if (ids->empty())
@@ -1320,7 +1324,7 @@ Decider::find_any_score(
/* next: already installed */
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { }) |
+ generator::Matches(spec, our_id, { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty() ^ is_block)
return std::make_pair(acs_already_installed, operator_bias);
@@ -1330,14 +1334,14 @@ Decider::find_any_score(
if (! is_block && spec.additional_requirements_ptr())
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements }) |
+ generator::Matches(spec, our_id, { mpo_ignore_additional_requirements }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty())
return std::make_pair(acs_wrong_options_installed, operator_bias);
}
const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
- our_id, make_null_shared_ptr(), our_resolution->resolvent(), dep, _already_met(dep.spec())));
+ our_id, make_null_shared_ptr(), our_resolution->resolvent(), dep, _already_met(dep.spec(), our_id)));
const std::shared_ptr<const Resolvents> resolvents(_get_resolvents_for(spec, reason).first);
/* next: will already be installing */
@@ -1374,7 +1378,7 @@ Decider::find_any_score(
if (is_block)
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { }) |
+ generator::Matches(spec, our_id, { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty())
return std::make_pair(acs_blocks_installed, operator_bias);
@@ -1384,7 +1388,7 @@ Decider::find_any_score(
if (! is_block)
{
const std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements })
+ generator::Matches(spec, our_id, { mpo_ignore_additional_requirements })
)]);
if (! ids->empty())
return std::make_pair(acs_exists, operator_bias);
@@ -1473,7 +1477,7 @@ Decider::_get_resolvents_for(
exact_slot = spec.slot_requirement_ptr()->accept_returning<std::shared_ptr<SlotName> >(f);
}
- return _imp->fns.get_resolvents_for_fn()(spec, exact_slot, reason);
+ return _imp->fns.get_resolvents_for_fn()(spec, maybe_from_package_id_from_reason(reason), exact_slot, reason);
}
const DestinationTypes
@@ -1847,9 +1851,9 @@ Decider::_find_id_for_from(
c != c_end ; ++c)
{
if ((*c)->spec().if_package())
- ok = ok && match_package(*_imp->env, *(*c)->spec().if_package(), *i, opts);
+ ok = ok && match_package(*_imp->env, *(*c)->spec().if_package(), *i, (*c)->from_id(), opts);
else
- ok = ok && ! match_package(*_imp->env, (*c)->spec().if_block()->blocking(), *i, opts);
+ ok = ok && ! match_package(*_imp->env, (*c)->spec().if_block()->blocking(), *i, (*c)->from_id(), opts);
if (! ok)
break;
@@ -1915,10 +1919,10 @@ Decider::_find_id_for_from(
if ((*c)->spec().if_package())
ok = ok && match_package_with_maybe_changes(*_imp->env, *(*c)->spec().if_package(),
- get_changed_choices_for(*c).get(), *i, why_changed_choices->changed_choices().get(), { });
+ get_changed_choices_for(*c).get(), *i, (*c)->from_id(), why_changed_choices->changed_choices().get(), { });
else
ok = ok && ! match_package_with_maybe_changes(*_imp->env, (*c)->spec().if_block()->blocking(),
- get_changed_choices_for(*c).get(), *i, why_changed_choices->changed_choices().get(), { });
+ get_changed_choices_for(*c).get(), *i, (*c)->from_id(), why_changed_choices->changed_choices().get(), { });
}
if (ok)
@@ -2113,10 +2117,10 @@ Decider::resolve()
}
bool
-Decider::_already_met(const PackageOrBlockDepSpec & spec) const
+Decider::_already_met(const PackageOrBlockDepSpec & spec, const std::shared_ptr<const PackageID> & from_id) const
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(spec.if_package() ? *spec.if_package() : spec.if_block()->blocking(), { }) |
+ generator::Matches(spec.if_package() ? *spec.if_package() : spec.if_block()->blocking(), from_id, { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (installed_ids->empty())
return bool(spec.if_block());
@@ -2386,6 +2390,7 @@ namespace
result->push_back(make_shared_copy(make_named_values<Constraint>(
n::destination_type() = destination_type,
n::force_unable() = false,
+ n::from_id() = from_constraint->from_id(),
n::nothing_is_fine_too() = true,
n::reason() = std::make_shared<LikeOtherDestinationTypeReason>(
resolvent,
diff --git a/paludis/resolver/decider.hh b/paludis/resolver/decider.hh
index c3f1d9ce4..c040588e6 100644
--- a/paludis/resolver/decider.hh
+++ b/paludis/resolver/decider.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -240,7 +240,9 @@ namespace paludis
const std::shared_ptr<const PackageID> &,
const bool existing) const;
- bool _already_met(const PackageOrBlockDepSpec &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool _already_met(
+ const PackageOrBlockDepSpec &,
+ const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
bool _installed_but_allowed_to_remove(
const std::shared_ptr<const Resolution> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/resolver/get_constraints_for_dependent_helper.cc b/paludis/resolver/get_constraints_for_dependent_helper.cc
index d27f9a64e..1a5cfc351 100644
--- a/paludis/resolver/get_constraints_for_dependent_helper.cc
+++ b/paludis/resolver/get_constraints_for_dependent_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -27,6 +27,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
@@ -47,7 +48,8 @@ namespace paludis
PackageDepSpecCollection less_restrictive_remove_blockers_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ less_restrictive_remove_blockers_specs(make_null_shared_ptr())
{
}
};
@@ -94,6 +96,7 @@ GetConstraintsForDependentHelper::operator() (
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::force_unable() = false,
+ n::from_id() = id,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(*spec), *spec, bk_weak),
diff --git a/paludis/resolver/get_constraints_for_purge_helper.cc b/paludis/resolver/get_constraints_for_purge_helper.cc
index 631a1e423..7c51fdedc 100644
--- a/paludis/resolver/get_constraints_for_purge_helper.cc
+++ b/paludis/resolver/get_constraints_for_purge_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -27,6 +27,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
@@ -47,7 +48,8 @@ namespace paludis
PackageDepSpecCollection purge_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ purge_specs(make_null_shared_ptr())
{
}
};
@@ -85,6 +87,7 @@ GetConstraintsForPurgeHelper::operator() (
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::force_unable() = false,
+ n::from_id() = id,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(spec), spec, bk_weak),
diff --git a/paludis/resolver/get_constraints_for_via_binary_helper.cc b/paludis/resolver/get_constraints_for_via_binary_helper.cc
index ee7ea91ff..c8b6f74b6 100644
--- a/paludis/resolver/get_constraints_for_via_binary_helper.cc
+++ b/paludis/resolver/get_constraints_for_via_binary_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,6 +28,7 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/partially_made_package_dep_spec.hh>
@@ -71,6 +72,7 @@ GetConstraintsForViaBinaryHelper::operator() (
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::force_unable() = false,
+ n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = false,
n::reason() = reason,
n::spec() = spec,
diff --git a/paludis/resolver/get_initial_constraints_for_helper.cc b/paludis/resolver/get_initial_constraints_for_helper.cc
index 85b154072..a26fd1c7b 100644
--- a/paludis/resolver/get_initial_constraints_for_helper.cc
+++ b/paludis/resolver/get_initial_constraints_for_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -87,11 +87,11 @@ GetInitialConstraintsForHelper::add_without_spec(const PackageDepSpec & spec)
}
void
-GetInitialConstraintsForHelper::add_preset_spec(const PackageDepSpec & spec)
+GetInitialConstraintsForHelper::add_preset_spec(const PackageDepSpec & spec, const std::shared_ptr<const PackageID> & from_id)
{
auto reason(std::make_shared<PresetReason>("preset", make_null_shared_ptr()));
- auto ids((*_imp->env)[selection::BestVersionInEachSlot(generator::Matches(spec, { }))]);
+ auto ids((*_imp->env)[selection::BestVersionInEachSlot(generator::Matches(spec, from_id, { }))]);
for (auto i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
@@ -101,6 +101,7 @@ GetInitialConstraintsForHelper::add_preset_spec(const PackageDepSpec & spec)
const std::shared_ptr<Constraint> constraint(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = r.destination_type(),
n::force_unable() = false,
+ n::from_id() = from_id,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = spec,
@@ -234,6 +235,7 @@ GetInitialConstraintsForHelper::_make_initial_constraints_for(
result->add(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolvent.destination_type(),
n::force_unable() = false,
+ n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = true,
n::reason() = std::make_shared<PresetReason>("is scm", make_null_shared_ptr()),
n::spec() = make_package_dep_spec({ }).package(resolvent.package()),
diff --git a/paludis/resolver/get_initial_constraints_for_helper.hh b/paludis/resolver/get_initial_constraints_for_helper.hh
index cdc3b3cce..c42f01f15 100644
--- a/paludis/resolver/get_initial_constraints_for_helper.hh
+++ b/paludis/resolver/get_initial_constraints_for_helper.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -47,7 +47,7 @@ namespace paludis
void add_without_spec(const PackageDepSpec &);
- void add_preset_spec(const PackageDepSpec &);
+ void add_preset_spec(const PackageDepSpec &, const std::shared_ptr<const PackageID> & from_id);
void add_suggested_restart(const SuggestRestart &);
diff --git a/paludis/resolver/get_resolvents_for_helper.cc b/paludis/resolver/get_resolvents_for_helper.cc
index 24a6f36c5..02f658deb 100644
--- a/paludis/resolver/get_resolvents_for_helper.cc
+++ b/paludis/resolver/get_resolvents_for_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -264,6 +264,7 @@ namespace
std::pair<std::shared_ptr<Resolvents>, bool>
GetResolventsForHelper::operator() (
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const std::shared_ptr<const SlotName> & maybe_slot,
const std::shared_ptr<const Reason> & reason) const
{
@@ -271,7 +272,7 @@ GetResolventsForHelper::operator() (
std::shared_ptr<const PackageID> best;
auto ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements }) |
+ generator::Matches(spec, from_id, { mpo_ignore_additional_requirements }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked() |
(maybe_slot ? Filter(filter::Slot(*maybe_slot)) : Filter(filter::All())))]);
@@ -280,7 +281,7 @@ GetResolventsForHelper::operator() (
best = *ids->begin();
auto installed_ids((*_imp->env)[selection::BestVersionInEachSlot(
- generator::Matches(spec, { }) |
+ generator::Matches(spec, from_id, { }) |
(_imp->target_destination_type == dt_install_to_chroot ?
Filter(filter::InstalledNotAtRoot(_imp->env->system_root_key()->value())) :
Filter(filter::InstalledAtRoot(_imp->env->system_root_key()->value()))))]);
diff --git a/paludis/resolver/get_resolvents_for_helper.hh b/paludis/resolver/get_resolvents_for_helper.hh
index 03ebdef11..c310815bf 100644
--- a/paludis/resolver/get_resolvents_for_helper.hh
+++ b/paludis/resolver/get_resolvents_for_helper.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -57,6 +57,7 @@ namespace paludis
std::pair<std::shared_ptr<Resolvents>, bool> operator() (
const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> & from_id,
const std::shared_ptr<const SlotName> &,
const std::shared_ptr<const Reason> &) const;
};
diff --git a/paludis/resolver/interest_in_spec_helper.cc b/paludis/resolver/interest_in_spec_helper.cc
index 35f5fc9d1..2427cbe4a 100644
--- a/paludis/resolver/interest_in_spec_helper.cc
+++ b/paludis/resolver/interest_in_spec_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,6 +28,7 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -65,6 +66,8 @@ namespace paludis
Imp(const Environment * const e) :
env(e),
+ no_blockers_from_specs(make_null_shared_ptr()),
+ no_dependencies_from_specs(make_null_shared_ptr()),
follow_installed_build_dependencies(false),
follow_installed_dependencies(true),
take_suggestions(indeterminate),
@@ -201,7 +204,7 @@ namespace
const std::shared_ptr<const PackageIDSequence> installed_ids(
(*env)[selection::SomeArbitraryVersion(
- generator::Matches(*dep.spec().if_package(), { }) |
+ generator::Matches(*dep.spec().if_package(), dep.from_id(), { }) |
filter::InstalledAtRoot(env->system_root_key()->value()))]);
if (installed_ids->empty())
return false;
@@ -271,7 +274,7 @@ InterestInSpecHelper::operator() (
for (auto l(_imp->take_from_specs.begin()), l_end(_imp->take_from_specs.end()) ;
l != l_end ; ++l)
{
- if (match_package(*_imp->env, *l, id, { }))
+ if (match_package(*_imp->env, *l, id, make_null_shared_ptr(), { }))
return si_take;
}
@@ -300,7 +303,7 @@ InterestInSpecHelper::operator() (
for (auto l(_imp->ignore_from_specs.begin()), l_end(_imp->ignore_from_specs.end()) ;
l != l_end ; ++l)
{
- if (match_package(*_imp->env, *l, id, { }))
+ if (match_package(*_imp->env, *l, id, make_null_shared_ptr(), { }))
return si_ignore;
}
@@ -328,7 +331,7 @@ InterestInSpecHelper::operator() (
{
const std::shared_ptr<const PackageIDSequence> installed_ids(
(*_imp->env)[selection::SomeArbitraryVersion(
- generator::Matches(*dep.spec().if_package(), { }) |
+ generator::Matches(*dep.spec().if_package(), dep.from_id(), { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty())
return si_take;
diff --git a/paludis/resolver/order_early_helper.cc b/paludis/resolver/order_early_helper.cc
index 2ea967ef0..11af1a767 100644
--- a/paludis/resolver/order_early_helper.cc
+++ b/paludis/resolver/order_early_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -24,6 +24,7 @@
#include <paludis/resolver/decision_utils.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -40,7 +41,9 @@ namespace paludis
PackageDepSpecCollection late_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ early_specs(make_null_shared_ptr()),
+ late_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/reason_utils-fwd.hh b/paludis/resolver/reason_utils-fwd.hh
index 23cf6e593..b616b1e53 100644
--- a/paludis/resolver/reason_utils-fwd.hh
+++ b/paludis/resolver/reason_utils-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,6 +22,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/resolver/reason-fwd.hh>
+#include <paludis/package_id-fwd.hh>
#include <memory>
namespace paludis
@@ -29,6 +30,9 @@ namespace paludis
namespace resolver
{
bool is_target(const std::shared_ptr<const Reason> &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ const std::shared_ptr<const PackageID> maybe_from_package_id_from_reason(
+ const std::shared_ptr<const Reason> &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
}
}
diff --git a/paludis/resolver/reason_utils.cc b/paludis/resolver/reason_utils.cc
index 063bd7703..724b23c77 100644
--- a/paludis/resolver/reason_utils.cc
+++ b/paludis/resolver/reason_utils.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -19,6 +19,7 @@
#include <paludis/resolver/reason_utils.hh>
#include <paludis/resolver/reason.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
using namespace paludis;
using namespace paludis::resolver;
@@ -67,6 +68,49 @@ namespace
return r.reason_for_set()->accept_returning<bool>(*this);
}
};
+
+ struct FromIDVisitor
+ {
+ std::shared_ptr<const PackageID> visit(const DependencyReason & r) const
+ {
+ return r.from_id();
+ }
+
+ std::shared_ptr<const PackageID> visit(const DependentReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const WasUsedByReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const PresetReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const ViaBinaryReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const TargetReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const LikeOtherDestinationTypeReason & r) const
+ {
+ return r.reason_for_other()->accept_returning<std::shared_ptr<const PackageID> >(*this);
+ }
+
+ std::shared_ptr<const PackageID> visit(const SetReason & r) const
+ {
+ return r.reason_for_set()->accept_returning<std::shared_ptr<const PackageID> >(*this);
+ }
+ };
}
bool
@@ -76,3 +120,10 @@ paludis::resolver::is_target(const std::shared_ptr<const Reason> & reason)
return reason->accept_returning<bool>(v);
}
+const std::shared_ptr<const PackageID>
+paludis::resolver::maybe_from_package_id_from_reason(const std::shared_ptr<const Reason> & reason)
+{
+ FromIDVisitor v;
+ return reason->accept_returning<std::shared_ptr<const PackageID> >(v);
+}
+
diff --git a/paludis/resolver/remove_if_dependent_helper.cc b/paludis/resolver/remove_if_dependent_helper.cc
index 7a8baa0f9..4e6116d31 100644
--- a/paludis/resolver/remove_if_dependent_helper.cc
+++ b/paludis/resolver/remove_if_dependent_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,6 +23,7 @@
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -38,7 +39,8 @@ namespace paludis
PackageDepSpecCollection remove_if_dependent_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ remove_if_dependent_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index 4074599e1..4a286e0ed 100644
--- a/paludis/resolver/resolver_functions.hh
+++ b/paludis/resolver/resolver_functions.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -137,6 +137,7 @@ namespace paludis
typedef std::function<std::pair<std::shared_ptr<Resolvents>, bool> (
const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const SlotName> &,
const std::shared_ptr<const Reason> &
)> GetResolventsForFunction;
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 02a8b6f2c..87419b2c4 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -378,6 +378,7 @@ namespace
n::active_dependency_labels() = *labels_stack.begin(),
n::active_dependency_labels_as_string() = adl.str(),
n::active_dependency_labels_classifier() = classifier,
+ n::from_id() = our_id,
n::metadata_key_human_name() = human_name,
n::metadata_key_raw_name() = raw_name,
n::original_specs_as_string() = original_specs_as_string,
@@ -542,6 +543,7 @@ SanitisedDependency::serialise(Serialiser & s) const
.member(SerialiserFlags<>(), "active_conditions_as_string", active_conditions_as_string())
.member(SerialiserFlags<>(), "active_dependency_labels_as_string", active_dependency_labels_as_string())
.member(SerialiserFlags<serialise::might_be_null>(), "active_dependency_labels_classifier", active_dependency_labels_classifier())
+ .member(SerialiserFlags<serialise::might_be_null>(), "from_id", from_id())
.member(SerialiserFlags<>(), "metadata_key_human_name", metadata_key_human_name())
.member(SerialiserFlags<>(), "metadata_key_raw_name", metadata_key_raw_name())
.member(SerialiserFlags<>(), "original_specs_as_string", original_specs_as_string())
@@ -561,6 +563,7 @@ SanitisedDependency::deserialise(Deserialisation & d, const std::shared_ptr<cons
n::active_dependency_labels() = make_null_shared_ptr(),
n::active_dependency_labels_as_string() = v.member<std::string>("active_dependency_labels_as_string"),
n::active_dependency_labels_classifier() = v.member<std::shared_ptr<LabelsClassifier> >("active_dependency_labels_classifier"),
+ n::from_id() = v.member<std::shared_ptr<const PackageID> >("from_id"),
n::metadata_key_human_name() = v.member<std::string>("metadata_key_human_name"),
n::metadata_key_raw_name() = v.member<std::string>("metadata_key_raw_name"),
n::original_specs_as_string() = v.member<std::string>("original_specs_as_string"),
diff --git a/paludis/resolver/sanitised_dependencies.hh b/paludis/resolver/sanitised_dependencies.hh
index cbfa4e0a9..dd270391b 100644
--- a/paludis/resolver/sanitised_dependencies.hh
+++ b/paludis/resolver/sanitised_dependencies.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -40,6 +40,7 @@ namespace paludis
typedef Name<struct name_active_dependency_labels> active_dependency_labels;
typedef Name<struct name_active_dependency_labels_as_string> active_dependency_labels_as_string;
typedef Name<struct name_active_dependency_labels_classifier> active_dependency_labels_classifier;
+ typedef Name<struct name_from_id> from_id;
typedef Name<struct name_metadata_key_human_name> metadata_key_human_name;
typedef Name<struct name_metadata_key_raw_name> metadata_key_raw_name;
typedef Name<struct name_original_specs_as_string> original_specs_as_string;
@@ -54,6 +55,7 @@ namespace paludis
NamedValue<n::active_dependency_labels, std::shared_ptr<const DependenciesLabelSequence> > active_dependency_labels;
NamedValue<n::active_dependency_labels_as_string, std::string> active_dependency_labels_as_string;
NamedValue<n::active_dependency_labels_classifier, std::shared_ptr<const LabelsClassifier> > active_dependency_labels_classifier;
+ NamedValue<n::from_id, std::shared_ptr<const PackageID> > from_id;
NamedValue<n::metadata_key_human_name, std::string> metadata_key_human_name;
NamedValue<n::metadata_key_raw_name, std::string> metadata_key_raw_name;
NamedValue<n::original_specs_as_string, std::string> original_specs_as_string;