aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2014-03-06 19:02:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2014-03-06 19:02:29 +0000
commit12e3419717f48a544b5fe79ab0a166ad0208e778 (patch)
treeaaf6e033d6f12cd793b310d24c8ac2350e67371d
parentdc5ee49682b15d687b185401ee606fc08f75c6c8 (diff)
downloadpaludis-12e3419717f48a544b5fe79ab0a166ad0208e778.tar.gz
paludis-12e3419717f48a544b5fe79ab0a166ad0208e778.tar.xz
Fix segfault
-rw-r--r--paludis/resolver/decider.cc2
-rw-r--r--paludis/resolver/prefer_or_avoid_helper.cc8
-rw-r--r--paludis/resolver/prefer_or_avoid_helper.hh4
-rw-r--r--paludis/resolver/resolver_functions.hh5
4 files changed, 10 insertions, 9 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 8e24af4..21a5c78 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1235,7 +1235,7 @@ Decider::find_any_score(
/* explicit preferences come first */
if (spec.package_ptr())
{
- Tribool prefer_or_avoid(_imp->fns.prefer_or_avoid_fn()(spec));
+ Tribool prefer_or_avoid(_imp->fns.prefer_or_avoid_fn()(spec, our_id));
if (prefer_or_avoid.is_true())
return std::make_pair(is_block ? acs_avoid : acs_prefer, operator_bias);
else if (prefer_or_avoid.is_false())
diff --git a/paludis/resolver/prefer_or_avoid_helper.cc b/paludis/resolver/prefer_or_avoid_helper.cc
index 318dfff..9b8405d 100644
--- a/paludis/resolver/prefer_or_avoid_helper.cc
+++ b/paludis/resolver/prefer_or_avoid_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2010, 2011, 2014 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
@@ -81,7 +81,7 @@ PreferOrAvoidHelper::add_avoid_matching(const std::shared_ptr<const PackageIDSeq
}
Tribool
-PreferOrAvoidHelper::operator() (const PackageDepSpec & s) const
+PreferOrAvoidHelper::operator() (const PackageDepSpec & s, const std::shared_ptr<const PackageID> & id) const
{
if (s.package_ptr())
{
@@ -97,7 +97,7 @@ PreferOrAvoidHelper::operator() (const PackageDepSpec & s) const
{
bool all(true);
for (auto q((*p)->begin()), q_end((*p)->end()) ; q != q_end ; ++q)
- if (! match_package(*_imp->env, s, *q, nullptr, { }))
+ if (! match_package(*_imp->env, s, *q, id, { }))
{
all = false;
break;
@@ -111,7 +111,7 @@ PreferOrAvoidHelper::operator() (const PackageDepSpec & s) const
p != p_end ; ++p)
{
for (auto q((*p)->begin()), q_end((*p)->end()) ; q != q_end ; ++q)
- if (match_package(*_imp->env, s, *q, nullptr, { }))
+ if (match_package(*_imp->env, s, *q, id, { }))
return false;
}
diff --git a/paludis/resolver/prefer_or_avoid_helper.hh b/paludis/resolver/prefer_or_avoid_helper.hh
index 7d1c6ea..3d4d45c 100644
--- a/paludis/resolver/prefer_or_avoid_helper.hh
+++ b/paludis/resolver/prefer_or_avoid_helper.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2010, 2011, 2014 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 @@ namespace paludis
void add_prefer_matching(const std::shared_ptr<const PackageIDSequence> &);
void add_avoid_matching(const std::shared_ptr<const PackageIDSequence> &);
- Tribool operator() (const PackageDepSpec &) const;
+ Tribool operator() (const PackageDepSpec &, const std::shared_ptr<const PackageID> &) const;
};
}
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index ebdeda4..aefb6de 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, 2011 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011, 2014 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
@@ -182,7 +182,8 @@ namespace paludis
)> OrderEarlyFunction;
typedef std::function<Tribool (
- const PackageDepSpec &
+ const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> &
)> PreferOrAvoidFunction;
typedef std::function<std::shared_ptr<const PackageIDSequence> (