summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/en/aptitude.xml16
-rw-r--r--src/cmdline/cmdline_show.cc2
-rw-r--r--src/cmdline/cmdline_why.cc10
-rw-r--r--src/dep_item.cc1
-rw-r--r--src/generic/apt/apt.h21
-rw-r--r--src/generic/apt/aptitude_resolver_universe.cc28
-rw-r--r--src/generic/apt/aptitude_resolver_universe.h57
-rw-r--r--src/generic/apt/infer_reason.cc20
-rw-r--r--src/generic/apt/matchers.cc2
-rw-r--r--src/pkg_columnizer.cc4
-rw-r--r--src/reason_fragment.cc8
-rw-r--r--src/solution_fragment.cc5
12 files changed, 115 insertions, 59 deletions
diff --git a/doc/en/aptitude.xml b/doc/en/aptitude.xml
index 0e7d5cb0..e86bfc80 100644
--- a/doc/en/aptitude.xml
+++ b/doc/en/aptitude.xml
@@ -197,7 +197,8 @@
Some packages require other packages in order to function. In
Debian, packages can <firstterm>depend</firstterm> upon,
<firstterm>recommend</firstterm>,
- <firstterm>suggest</firstterm>, or
+ <firstterm>suggest</firstterm>,
+ <firstterm>break</firstterm>, or
<firstterm>conflict</firstterm> with other packages.
</para>
@@ -4244,6 +4245,7 @@ iuAU wesnoth-data +930kB 0.8.7-1 0.8.8-1.0w
<quote><literal>predepends</literal></quote>,
<quote><literal>recommends</literal></quote>,
<quote><literal>suggests</literal></quote>,
+ <quote><literal>breaks</literal></quote>,
<quote><literal>conflicts</literal></quote>, or
<quote><literal>replaces</literal></quote>.
</para>
@@ -4256,7 +4258,7 @@ iuAU wesnoth-data +930kB 0.8.7-1 0.8.8-1.0w
<listitem>
<para>
Matches packages that are <quote>broken</quote>: they have an
- unfulfilled dependency, predependency, or conflict.
+ unfulfilled dependency, predependency, breaks, or conflict.
</para>
</listitem>
</varlistentry>
@@ -10101,6 +10103,16 @@ Minesweeper Minesweeper Lost in 2388 second
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term>Support for the dpkg Breaks field</term>
+
+ <listitem>
+ <para>
+ Ian Jackson, Michael Vogt
+ </para>
+ </listitem>
+ </varistentry>
</variablelist>
</chapter>
diff --git a/src/cmdline/cmdline_show.cc b/src/cmdline/cmdline_show.cc
index 51b12768..e7a9badf 100644
--- a/src/cmdline/cmdline_show.cc
+++ b/src/cmdline/cmdline_show.cc
@@ -411,6 +411,8 @@ static fragment *version_file_fragment(pkgCache::VerIterator ver,
fragments.push_back(dep_lst_frag(ver.DependsList(),
_("Conflicts"), pkgCache::Dep::Conflicts));
fragments.push_back(dep_lst_frag(ver.DependsList(),
+ _("Breaks"), pkgCache::Dep::DpkgBreaks));
+ fragments.push_back(dep_lst_frag(ver.DependsList(),
_("Replaces"), pkgCache::Dep::Replaces));
fragments.push_back(dep_lst_frag(ver.DependsList(),
_("Obsoletes"), pkgCache::Dep::Obsoletes));
diff --git a/src/cmdline/cmdline_why.cc b/src/cmdline/cmdline_why.cc
index a676bc45..9512db49 100644
--- a/src/cmdline/cmdline_why.cc
+++ b/src/cmdline/cmdline_why.cc
@@ -227,6 +227,7 @@ namespace
case pkgCache::Dep::Depends:
case pkgCache::Dep::PreDepends:
case pkgCache::Dep::Conflicts:
+ case pkgCache::Dep::DpkgBreaks:
return true;
case pkgCache::Dep::Recommends:
return dep_level == Recommends || dep_level == Suggests;
@@ -564,7 +565,7 @@ namespace
{
// If we walked through a Provides, we can only look at conflicts.
if(!params.get_allow_choices() &&
- dep->Type != pkgCache::Dep::Conflicts &&
+ !is_conflict(dep->Type) &&
is_provides())
continue;
@@ -572,7 +573,8 @@ namespace
pkgCache::DepIterator start, end;
// Drop ORs if choices are disallowed. Note that ORs are
// meaningless for conflicts, so we ignore them there.
- if(!params.get_allow_choices() && dep->Type != pkgCache::Dep::Conflicts)
+ if(!params.get_allow_choices() &&
+ !is_conflict(dep->Type))
{
// Check if we're in an OR by checking whether either
// (a) the OR flag is set, or (b) this isn't the first
@@ -597,7 +599,7 @@ namespace
if(is_remove())
{
// Remove, ProvidesRemove nodes take this.
- if(dep->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(dep->Type))
{
if(verbosity > 1)
std::cout << _(" ++ --> skipping, not a conflict\n");
@@ -607,7 +609,7 @@ namespace
else
{
// Install, ProvidesInstall nodes take this.
- if(dep->Type == pkgCache::Dep::Conflicts)
+ if(is_conflict(dep->Type))
{
if(verbosity > 1)
std::cout << _(" ++ --> skipping conflict\n");
diff --git a/src/dep_item.cc b/src/dep_item.cc
index 0423e5cb..1c7f1883 100644
--- a/src/dep_item.cc
+++ b/src/dep_item.cc
@@ -158,6 +158,7 @@ style pkg_depitem::get_normal_style()
void pkg_depitem::select(undo_group *undo)
{
if(firstdep->Type!=pkgCache::Dep::Conflicts &&
+ firstdep->Type!=pkgCache::Dep::DpkgBreaks &&
firstdep->Type!=pkgCache::Dep::Replaces)
{
bool last_or=true;
diff --git a/src/generic/apt/apt.h b/src/generic/apt/apt.h
index 891644fb..27cab7e4 100644
--- a/src/generic/apt/apt.h
+++ b/src/generic/apt/apt.h
@@ -240,4 +240,25 @@ public:
}
};
+/** \return \b true if the given dependency type is Conflicts or
+ * Breaks.
+ *
+ * We need this overload because the Type field of the dependency
+ * structure is an unsigned char, not a DepType.
+ */
+inline bool is_conflict(unsigned char type)
+{
+ return
+ type == pkgCache::Dep::Conflicts ||
+ type == pkgCache::Dep::DpkgBreaks;
+}
+
+/** \return \b true if the given dependency type is Conflicts or
+ * Breaks.
+ */
+inline bool is_conflict(pkgCache::Dep::DepType type)
+{
+ return is_conflict(static_cast<unsigned char>(type));
+}
+
#endif
diff --git a/src/generic/apt/aptitude_resolver_universe.cc b/src/generic/apt/aptitude_resolver_universe.cc
index 7ff991e4..a3a8d621 100644
--- a/src/generic/apt/aptitude_resolver_universe.cc
+++ b/src/generic/apt/aptitude_resolver_universe.cc
@@ -36,7 +36,7 @@ bool ver_disappeared(const pkgCache::VerIterator ver)
static bool empty_conflict(const pkgCache::DepIterator &dep,
const pkgCache::PrvIterator &prv)
{
- if(dep->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(dep->Type))
return false;
if(prv.end())
@@ -124,7 +124,7 @@ bool aptitude_resolver_version::revdep_iterator::applicable() const
//
// As a bonus, this lets us match what gets generated for forward
// deps.
- if(dep_lst->Type == pkgCache::Dep::Conflicts &&
+ if(is_conflict(dep_lst->Type) &&
!prv_lst.end() &&
const_cast<pkgCache::PrvIterator &>(prv_lst).OwnerPkg() == const_cast<pkgCache::DepIterator &>(dep_lst).ParentPkg())
return false;
@@ -209,7 +209,7 @@ inline void aptitude_resolver_version::dep_iterator::advance()
// If we weren't trying to iterate over a Provides list *and* the
// current dep is a non-versioned Conflicts, start such an
// iteration.
- else if(!prv_open && dep->Type == pkgCache::Dep::Conflicts &&
+ else if(!prv_open && is_conflict(dep->Type) &&
!dep.TargetVer())
{
prv = dep.TargetPkg().ProvidesList();
@@ -224,7 +224,7 @@ inline void aptitude_resolver_version::dep_iterator::advance()
if(move_to_next_dep)
{
- if(!dep.end() && dep->Type == pkgCache::Dep::Conflicts)
+ if(!dep.end() && is_conflict(dep->Type))
++dep;
else
{
@@ -250,7 +250,7 @@ aptitude_resolver_version::dep_iterator::applicable(const pkgCache::DepIterator
{
eassert(!dep.end());
eassert(!prv.end());
- eassert(dep->Type == pkgCache::Dep::Conflicts);
+ eassert(is_conflict(dep->Type));
if(const_cast<pkgCache::PrvIterator &>(prv).OwnerPkg() == const_cast<pkgCache::DepIterator &>(dep).ParentPkg())
return false;
@@ -269,7 +269,7 @@ aptitude_resolver_version::dep_iterator::applicable(const pkgCache::DepIterator
bool aptitude_resolver_version::dep_iterator::applicable()
{
- if(dep->Type == pkgCache::Dep::Conflicts)
+ if(is_conflict(dep->Type))
// In this case the current dependency is represented completely
// by the depends and provides iterators; no need to step.
return applicable(dep, prv, prv_open, cache);
@@ -302,7 +302,7 @@ void aptitude_resolver_version::dep_iterator::normalize()
void aptitude_resolver_dep::solver_iterator::normalize()
{
- if(dep_lst->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(dep_lst->Type))
{
while(!end())
{
@@ -362,7 +362,7 @@ void aptitude_resolver_dep::solver_iterator::normalize()
}
else
{
- // For Conflicts, we're iterating over all the versions of
+ // For Conflicts/Breaks, we're iterating over all the versions of
// *one* package for *one* dep, either the owner of the
// dep or a provided package. (prv_lst is mostly
// unnecessary, but it makes it simple to remember whether
@@ -383,7 +383,7 @@ void aptitude_resolver_dep::solver_iterator::normalize()
++ver_lst;
}
// Important point: end version iterators always match
- // a Conflicts! (i.e., any Conflicts can be resolved
+ // a Conflicts/Breaks! (i.e., those can always be resolved
// by removing the conflicted package)
return;
}
@@ -419,7 +419,7 @@ bool aptitude_resolver_dep::solved_by(const aptitude_resolver_version &v) const
// Now check each of the members of the OR group.
pkgCache::DepIterator d = start;
- if(start->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(start->Type))
{
// Of course, installing an end version never fixes a
// non-conflict unless it removes the source (tested for above).
@@ -480,7 +480,7 @@ aptitude_resolver_dep::solver_iterator &aptitude_resolver_dep::solver_iterator::
if(!ver_lst.end())
++ver_lst;
- else if(dep_lst->Type != pkgCache::Dep::Conflicts)
+ else if(!is_conflict(dep_lst->Type))
{
if(!prv_lst.end())
++prv_lst;
@@ -511,7 +511,7 @@ aptitude_resolver_version aptitude_resolver_dep::solver_iterator::operator*() co
return aptitude_resolver_version(ver_lst.ParentPkg(),ver_lst,cache);
else // In this case we're trying to remove some package or other.
{
- if(dep_lst->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(dep_lst->Type))
{
// Assume this because otherwise end() should be true.
eassert(!prv_lst.end());
@@ -603,7 +603,7 @@ void aptitude_universe::broken_dep_iterator::normalize()
// Now dep is a broken critical dep or an end dep. If it is a
// conflicts, we might need to push down into Provides...
- if(!the_dep.end() && the_dep->Type == pkgCache::Dep::Conflicts)
+ if(!the_dep.end() && is_conflict(the_dep->Type))
{
// If we aren't in provides, check whether the dep is
// trivially broken (i.e., without following provides).
@@ -693,7 +693,7 @@ aptitude_universe::broken_dep_iterator &aptitude_universe::broken_dep_iterator::
// If the_dep.end() we have pkg.end().
eassert(!the_dep.end());
- if(!prv_open && the_dep->Type == pkgCache::Dep::Conflicts)
+ if(!prv_open && is_conflict(the_dep->Type))
{
prv_open = true;
prv = the_dep.TargetPkg().ProvidesList();
diff --git a/src/generic/apt/aptitude_resolver_universe.h b/src/generic/apt/aptitude_resolver_universe.h
index 86d34354..2f2f0549 100644
--- a/src/generic/apt/aptitude_resolver_universe.h
+++ b/src/generic/apt/aptitude_resolver_universe.h
@@ -256,14 +256,14 @@ inline aptitude_resolver_version aptitude_resolver_package::current_version() co
*
* This class is a model of the \ref universe_dep "Dependency concept".
*
- * Dependency relationships other than Conflicts are translated in a
+ * Dependency relationships other than Conflicts/Breaks are translated in a
* very straightforward manner: unversioned dependencies collect all
* the versions of the target package and are pushed backwards
* through Provides, while versioned dependencies collect all
* matching versions. ORed dependencies collect all the versions
* targeted by their subcomponents.
*
- * Conflicts relationships are handled by generating one abstract
+ * Conflicts/Breaks relationships are handled by generating one abstract
* dependency for the immediate conflict, and then a separate one for
* \e each provider of the conflicted name (if the conflict is
* unversioned, of course). The solvers of these conflicts are the
@@ -277,12 +277,13 @@ class aptitude_resolver_dep
{
pkgDepCache *cache;
pkgCache::DepIterator start;
- /** If start is a Conflicts and prv is not an end iterator, then the
- * object represents "V -> {V'_1 V'_2 ..} where the V'-s are
- * versions of prv.OwnerPkg() that do *not* provide V.ParentPkg().
- * Otherwise, if start is a Conflicts and prv is an end iterator,
- * the object represents the non-virtual part of the Conflicts; if
- * start is not a Conflicts, prv is unused.
+ /** If start is a Conflicts/Breaks and prv is not an end iterator,
+ * then the object represents "V -> {V'_1 V'_2 ..} where the V'-s
+ * are versions of prv.OwnerPkg() that do *not* provide
+ * V.ParentPkg(). Otherwise, if start is a Conflicts/Breaks and
+ * prv is an end iterator, the object represents the non-virtual
+ * part of the Conflicts/Breaks; if start is not a
+ * Conflicts/Breaks, prv is unused.
*
* All that discussion is mainly important when checking if the dep
* is broken and/or when finding its solvers.
@@ -300,7 +301,7 @@ public:
*
* \param dep The APT dependency to represent.
*
- * \param _prv If dep is a Conflicts, then this is either an end
+ * \param _prv If dep is a Conflicts/Breaks, then this is either an end
* iterator (indicating that this object represents the conflict on
* the real target package), or the Provides through which the
* conflict should be projected.
@@ -316,7 +317,7 @@ public:
eassert(const_cast<pkgCache::DepIterator &>(dep).Cache()!=0);
eassert(prv.Cache()!=0);
eassert(!dep.end());
- if(dep->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(dep->Type))
{
// Throw away the end, since it's not necessary.
pkgCache::DepIterator end;
@@ -342,14 +343,14 @@ public:
bool operator==(const aptitude_resolver_dep &other) const
{
return start == other.start &&
- (start->Type != pkgCache::Dep::Conflicts || prv == other.prv);
+ (!is_conflict(start->Type) || prv == other.prv);
}
/** \brief Compare two dependencies for equality. */
bool operator!=(const aptitude_resolver_dep &other) const
{
return start != other.start ||
- (start->Type == pkgCache::Dep::Conflicts && prv != other.prv);
+ (is_conflict(start->Type) && prv != other.prv);
}
/** \brief Orders dependencies according to their memory
@@ -361,7 +362,7 @@ public:
return true;
else if(((const pkgCache::Dependency *) start) > ((const pkgCache::Dependency *) other.start))
return false;
- else if(start->Type != pkgCache::Dep::Conflicts)
+ else if(!is_conflict(start->Type))
return false;
else if(((const pkgCache::Provides *) prv) < ((const pkgCache::Provides *) other.prv))
return true;
@@ -613,7 +614,7 @@ class aptitude_resolver_version::dep_iterator
pkgDepCache *cache;
pkgCache::DepIterator dep;
pkgCache::PrvIterator prv;
- /** If \b true, then dep is a Conflicts and we are iterating over
+ /** If \b true, then dep is a Conflicts/Breaks and we are iterating over
* the packages providing its target.
*/
bool prv_open;
@@ -734,7 +735,7 @@ class aptitude_resolver_dep::solver_iterator
public:
/** \brief Initialize a solution iterator for a dependency that is
- * not a Conflicts.
+ * not a Conflicts/Breaks.
*
* \param start The dependency whose targets should be enumerated.
*
@@ -750,7 +751,7 @@ public:
{
if(!dep_lst.end())
{
- eassert(dep_lst->Type != pkgCache::Dep::Conflicts);
+ eassert(!is_conflict(dep_lst->Type));
ver_lst=const_cast<pkgCache::DepIterator &>(start).TargetPkg().VersionList();
prv_lst=const_cast<pkgCache::DepIterator &>(start).TargetPkg().ProvidesList();
@@ -759,13 +760,13 @@ public:
normalize();
}
- /** \brief Initialize a solution iterator for a Conflicts.
+ /** \brief Initialize a solution iterator for a Conflicts/Breaks.
*
* \param d The conflict that we should iterate over solutions to.
*
- * \param p The Provides through which the Conflicts is being
- * projected, or an end iterator if we are handling a straight
- * Conflicts.
+ * \param p The Provides through which the Conflicts/Breaks is
+ * being projected, or an end iterator if we are handling a
+ * straight Conflicts/Breaks.
*
* \param _cache The package cache in which to work.
*/
@@ -776,7 +777,7 @@ public:
{
if(!dep_lst.end())
{
- eassert(d->Type == pkgCache::Dep::Conflicts);
+ eassert(is_conflict(d->Type));
// Either we're looking at all versions of the named dep, or
// at all versions of the providing package.
if(prv_lst.end())
@@ -833,7 +834,7 @@ public:
inline aptitude_resolver_dep::solver_iterator aptitude_resolver_dep::solvers_begin() const
{
- if(start->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(start->Type))
return solver_iterator(start, cache);
else
return solver_iterator(start, prv, cache);
@@ -846,7 +847,7 @@ bool aptitude_resolver_dep::broken_under(const InstallationType &I) const
if(const_cast<pkgCache::DepIterator &>(start).ParentVer() != I.version_of(aptitude_resolver_package(const_cast<pkgCache::DepIterator &>(start).ParentPkg(), cache)).get_ver())
return false;
- if(start->Type != pkgCache::Dep::Conflicts)
+ if(!is_conflict(start->Type))
{
pkgCache::DepIterator dep=start;
@@ -881,9 +882,9 @@ bool aptitude_resolver_dep::broken_under(const InstallationType &I) const
}
else
{
- // Recall that a Conflicts dep iterator is looking at a single
- // element of the Conflicts: either a direct conflict or an
- // indirect conflict (i.e., via a virtual pkg).
+ // Recall that a Conflicts/Breaks dep iterator is looking at a
+ // single element of the Conflicts/Breaks: either a direct
+ // conflict or an indirect conflict (i.e., via a virtual pkg).
if(prv.end())
{
@@ -1071,7 +1072,7 @@ public:
* a version iterator here.
*
* Note on OR groups: DepGInstall is only set on the last entry in
- * an OR group. But Conflicts should be handled individually. As
+ * an OR group. But Conflicts/Breaks should be handled individually. As
* I'm not even sure ORed conflicts are valid, none exist in the
* wild, and ORed conflicts are a Pointless Idea[tm] anyway, THIS
* WILL NOT PRODUCE CORRECT OUTPUT for ORed conflicts. \todo try
@@ -1084,7 +1085,7 @@ public:
class pkgCache::PkgIterator pkg;
class pkgCache::DepIterator the_dep;
- /** If the_dep is a Conflicts, then the following keep track
+ /** If the_dep is a Conflicts/Breaks, then the following keep track
* of which sub-relationship is being examined.
*/
class pkgCache::PrvIterator prv;
diff --git a/src/generic/apt/infer_reason.cc b/src/generic/apt/infer_reason.cc
index 639fe719..aee2a8e9 100644
--- a/src/generic/apt/infer_reason.cc
+++ b/src/generic/apt/infer_reason.cc
@@ -17,7 +17,7 @@
using namespace std;
// Report dependencies in the order:
-// PreDepends, Depends, Recommends, Conflicts, Suggests, Replaces, Obsoletes
+// PreDepends, Depends, Recommends, Conflicts, Breaks, Suggests, Replaces, Obsoletes
static int cmp_dep_types(unsigned char A, unsigned char B)
{
if(A==B)
@@ -51,6 +51,16 @@ static int cmp_dep_types(unsigned char A, unsigned char B)
default:
return -1;
}
+ case pkgCache::Dep::DpkgBreaks:
+ switch(B)
+ {
+ case pkgCache::Dep::Suggests:
+ case pkgCache::Dep::Replaces:
+ case pkgCache::Dep::Obsoletes:
+ return -1;
+ default:
+ return 1;
+ }
case pkgCache::Dep::Suggests:
switch(B)
{
@@ -104,7 +114,7 @@ static bool relevant_dep(pkgCache::VerIterator ver, pkgCache::DepIterator d)
* self-conflict on a pure virtual package that is not provided by
* any other package which is to be installed. (the last condition is
* because packages which will not be installed are uninteresting for
- * a Conflicts)
+ * a Conflicts/Breaks)
*
* \param dep the dependency to test.
*/
@@ -145,7 +155,7 @@ void infer_reason(pkgCache::PkgIterator pkg, set<reason> &reasons)
if(actionstate==pkg_auto_install)
{
for(rev_dep_iterator d(instver); !d.end(); ++d)
- if((*d)->Type!=pkgCache::Dep::Conflicts &&
+ if(!is_conflict((*d)->Type) &&
relevant_dep(instver, *d))
reasons.insert(reason((*d).ParentPkg(), *d));
}
@@ -166,7 +176,7 @@ void infer_reason(pkgCache::PkgIterator pkg, set<reason> &reasons)
{
// Look for *other* packages that conflict with this one.
for(rev_dep_iterator d(pkg.CurrentVer()); !d.end(); ++d)
- if((*d)->Type==pkgCache::Dep::Conflicts &&
+ if(is_conflict((*d)->Type) &&
relevant_dep(pkg.CurrentVer(), *d) &&
!is_simple_self_conflict(*d))
reasons.insert(reason((*d).ParentPkg(), *d));
@@ -260,7 +270,7 @@ void infer_reverse_breakage(pkgCache::PkgIterator &pkg,
reasons.insert(reason(dep.ParentPkg(), dep));
}
// Look at any conflict that's not an immediate self-conflict
- else if(dep->Type==pkgCache::Dep::Conflicts &&
+ else if(is_conflict(dep->Type) &&
(dep.TargetPkg()!=pkg || dep.ParentPkg()!=pkg))
{
pkgCache::VerIterator instver=(*apt_cache_file)[pkg].InstVerIter(*apt_cache_file);
diff --git a/src/generic/apt/matchers.cc b/src/generic/apt/matchers.cc
index 87b411c6..e9a2852c 100644
--- a/src/generic/apt/matchers.cc
+++ b/src/generic/apt/matchers.cc
@@ -1842,6 +1842,8 @@ pkgCache::Dep::DepType parse_deptype(const string &s)
return pkgCache::Dep::Suggests;
else if(!strcasecmp(s.c_str(), "conflicts"))
return pkgCache::Dep::Conflicts;
+ else if(!strcasecmp(s.c_str(), "breaks"))
+ return pkgCache::Dep::DpkgBreaks;
else if(!strcasecmp(s.c_str(), "replaces"))
return pkgCache::Dep::Replaces;
else // ewww.
diff --git a/src/pkg_columnizer.cc b/src/pkg_columnizer.cc
index cdb143c9..48a1d8a0 100644
--- a/src/pkg_columnizer.cc
+++ b/src/pkg_columnizer.cc
@@ -497,7 +497,7 @@ column_disposition pkg_item::pkg_columnizer::setup_column(const pkgCache::PkgIte
{
for(pkgCache::DepIterator D=pkg.RevDependsList(); !D.end(); D++)
if(D.IsCritical() &&
- D->Type!=pkgCache::Dep::Conflicts &&
+ !is_conflict(D->Type) &&
D.ParentVer()==D.ParentPkg().CurrentVer() &&
// That test is CORRECT; we want to see if the version
// providing the dependency is correct.
@@ -512,7 +512,7 @@ column_disposition pkg_item::pkg_columnizer::setup_column(const pkgCache::PkgIte
for(pkgCache::DepIterator D=i.ParentPkg().RevDependsList(); !D.end(); D++)
{
if(D.IsCritical() &&
- D->Type!=pkgCache::Dep::Conflicts &&
+ !is_conflict(D->Type) &&
D.ParentVer()==D.ParentPkg().CurrentVer() &&
_system->VS->CheckDep(i.ProvideVersion(), D->CompareOp, D.TargetVer()))
count++;
diff --git a/src/reason_fragment.cc b/src/reason_fragment.cc
index de828403..caca79cf 100644
--- a/src/reason_fragment.cc
+++ b/src/reason_fragment.cc
@@ -36,6 +36,8 @@ fragment *depname_frag(pkgCache::DepIterator dep)
style_attrs_on(A_BOLD));
case pkgCache::Dep::Conflicts: return text_fragment(_("conflicts with"),
style_attrs_on(A_BOLD));
+ case pkgCache::Dep::DpkgBreaks: return text_fragment(_("breaks"),
+ style_attrs_on(A_BOLD));
case pkgCache::Dep::Replaces: return text_fragment(_("replaces"));
case pkgCache::Dep::Obsoletes: return text_fragment(_("obsoletes"));
}
@@ -240,7 +242,7 @@ fragment *dep_singlefrag(pkgCache::PkgIterator pkg,
verfrag,
prvfrag(dep.TargetPkg(),
dep.ParentPkg(),
- dep->Type==pkgCache::Dep::Conflicts),
+ is_conflict(dep->Type)),
available?"":(string(" [")+_("UNAVAILABLE")+"]").c_str());
}
@@ -485,7 +487,7 @@ fragment *reason_fragment(const pkgCache::PkgIterator &pkg, bool &breakage)
fragments.push_back(wrapbox(fragf(_("The following packages conflict with %B%s%b and will be broken by its installation:"),
pkg.Name())));
else
- // up/downgrade; could be either Depends or Conflicts
+ // up/downgrade; could be either Depends or Conflicts/Breaks
{
bool has_depends=false;
bool has_conflicts=false;
@@ -495,7 +497,7 @@ fragment *reason_fragment(const pkgCache::PkgIterator &pkg, bool &breakage)
for(set<reason>::const_iterator i=reasons.begin();
i!=reasons.end(); ++i)
{
- if(i->dep->Type == pkgCache::Dep::Conflicts)
+ if(is_conflict(i->dep->Type))
has_conflicts=true;
else
has_depends=true;
diff --git a/src/solution_fragment.cc b/src/solution_fragment.cc
index 9bd9c798..09600cd1 100644
--- a/src/solution_fragment.cc
+++ b/src/solution_fragment.cc
@@ -116,6 +116,9 @@ wstring dep_text(const pkgCache::DepIterator &d)
case pkgCache::Dep::Conflicts:
return swsprintf(transcode(_("%s conflicts with %s")).c_str(),
name, targets.c_str());
+ case pkgCache::Dep::DpkgBreaks:
+ return swsprintf(transcode(_("%s breaks %s")).c_str(),
+ name, targets.c_str());
case pkgCache::Dep::Replaces:
return swsprintf(transcode(_("%s replaces %s")).c_str(),
name, targets.c_str());
@@ -130,7 +133,7 @@ wstring dep_text(const pkgCache::DepIterator &d)
wstring conflict_text(const pkgCache::DepIterator &conflict,
const pkgCache::PrvIterator &prv)
{
- if(prv.end() || conflict->Type != pkgCache::Dep::Conflicts)
+ if(prv.end() || !is_conflict(conflict->Type))
return dep_text(conflict);
return swsprintf(transcode(_("%s conflicts with %s [provided by %s %s]")).c_str(),