aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-27 16:51:21 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-27 16:51:21 +0100
commit01153084a9c4666da49d482d55bbdb56667b3b04 (patch)
treedb19886bd2e2b61648108174029d599a415011d5
parentfffe19b9ce7e93f0772897f38b3fecc3dfccb684 (diff)
downloadpaludis-01153084a9c4666da49d482d55bbdb56667b3b04.tar.gz
paludis-01153084a9c4666da49d482d55bbdb56667b3b04.tar.xz
Handle [use?]ish restarts correctly
-rw-r--r--paludis/resolver/resolver.cc30
-rw-r--r--paludis/resolver/resolver.hh2
2 files changed, 31 insertions, 1 deletions
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index da8a02d..a9fe5cd 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -663,9 +663,37 @@ Resolver::_make_constraint_for_preloading(
const std::tr1::shared_ptr<const Decision> &,
const std::tr1::shared_ptr<const Constraint> & c) const
{
- const std::tr1::shared_ptr<PresetReason> reason(new PresetReason);
const std::tr1::shared_ptr<Constraint> result(new Constraint(*c));
+
+ const std::tr1::shared_ptr<PresetReason> reason(new PresetReason);
result->reason() = reason;
+
+ if (result->spec().if_package())
+ {
+ PackageDepSpec s(_make_spec_for_preloading(*result->spec().if_package()));
+ result->spec().if_package() = make_shared_ptr(new PackageDepSpec(s));
+ }
+ else
+ {
+ PackageDepSpec s(_make_spec_for_preloading(result->spec().if_block()->blocking()));
+ result->spec().if_block() = make_shared_ptr(new BlockDepSpec(
+ "!" + stringify(s),
+ s,
+ result->spec().if_block()->strong()));
+ }
+
+ return result;
+}
+
+const PackageDepSpec
+Resolver::_make_spec_for_preloading(const PackageDepSpec & spec) const
+{
+ PartiallyMadePackageDepSpec result(spec);
+
+ /* we don't want to copy use deps from the constraint, since things like
+ * [foo?] start to get weird when there's no longer an associated ID. */
+ result.clear_additional_requirements();
+
return result;
}
diff --git a/paludis/resolver/resolver.hh b/paludis/resolver/resolver.hh
index 0ae43fd..54f71d5 100644
--- a/paludis/resolver/resolver.hh
+++ b/paludis/resolver/resolver.hh
@@ -109,6 +109,8 @@ namespace paludis
const std::tr1::shared_ptr<const Decision> & d,
const std::tr1::shared_ptr<const Constraint> & c) const;
+ const PackageDepSpec _make_spec_for_preloading(const PackageDepSpec & spec) const;
+
const std::tr1::shared_ptr<const PackageIDSequence> _find_replacing(
const std::tr1::shared_ptr<const PackageID> &,
const std::tr1::shared_ptr<const Repository> &) const;