diff options
author | Ian Jackson <ian@davenant.greenend.org.uk> | 2007-11-01 19:57:26 +0000 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2008-03-09 08:39:35 +0200 |
commit | 1863d6460975abf7a9f6259e1facbff130db55ae (patch) | |
tree | 9f81e86b271dbe160a386a615092195ab2cd8ed6 /dselect/pkgdepcon.cc | |
parent | e9d5e48bf30d5d15ec26db1ce223dd9944cb7305 (diff) | |
download | dpkg-1863d6460975abf7a9f6259e1facbff130db55ae.tar.gz |
Correct broken dselect logic for self-conflicting packages
The previous code seems to have had some confusion over the precedence
of '&&' vs ':'. The new rule is that a Conflicts is violated if the
target package is installed or to be error-preserved ie
would_like_to_install() != 0 - except that we disregard packages which
directly Conflict with themselves.
Diffstat (limited to 'dselect/pkgdepcon.cc')
-rw-r--r-- | dselect/pkgdepcon.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc index 70e6bda77..72232bd8c 100644 --- a/dselect/pkgdepcon.cc +++ b/dselect/pkgdepcon.cc @@ -353,6 +353,8 @@ int packagelist::resolvedepcon(dependency *depends) { } int packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade) { + // `satisfied' here for Conflicts and Breaks means that the + // restriction is violated ie that the target package is wanted int would; pkginfo::pkgwant want= pkginfo::want_purge; @@ -363,8 +365,9 @@ int packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade would= 0; } - if (!(possi->up->type == dep_conflicts && possi->up->up == possi->ed) && - possi->up->type == dep_conflicts ? (would != 0) : (would > 0)) { + if (possi->up->type == dep_conflicts + ? possi->up->up != possi->ed && would != 0 + : would > 0) { // If it's to be installed or left installed, then either it's of // the right version, and therefore OK, or a version must have // been specified, in which case we don't need to look at the rest |