From 1863d6460975abf7a9f6259e1facbff130db55ae Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 1 Nov 2007 19:57:26 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ debian/changelog | 2 ++ dselect/pkgdepcon.cc | 7 +++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 680d44d8..927e2e6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-03-09 Ian Jackson + + * dselect/pkgdepcon.cc (packagelist::deppossatisfied): 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. + 2008-03-07 Raphael Hertzog * scripts/Dpkg/Fields.pm: Import Dpkg::Gettext since we use _g(). diff --git a/debian/changelog b/debian/changelog index e0d2a093..49262d24 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,8 @@ dpkg (1.14.17) UNRELEASED; urgency=low package when debsig-verify is installed. Closes: #311843 * Fix some small memory leaks. Closes: #469520 Thanks to Sean Finney. + * Correct broken dselect logic for self-conflicting packages. + Thanks to Ian Jackson. [ Raphael Hertzog ] * Add a warning displayed by dpkg-genchanges if the current version is diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc index 70e6bda7..72232bd8 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 -- 2.39.5