Ver código fonte

Implement 'Breaks' properly in dselect

It works just like Conflicts. This is correct since dselect only deals
with packages being installed, removed or placed on hold.
Ian Jackson 18 anos atrás
pai
commit
c5eddb8983
3 arquivos alterados com 11 adições e 2 exclusões
  1. 7 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 2 2
      dselect/pkgdepcon.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2008-03-09  Ian Jackson  <ian@davenant.greenend.org.uk>
+
+	* dselect/pkgdepcon.cc (packagelist::resolvedepcon): Move dep_breaks
+	case after dep_conflicts so that it falls through.
+	(packagelist::deppossatisfied): Handle dep_breaks in the same way as
+	dep_conflicts.
+
 2008-03-09  Ian Jackson  <ian@davenant.greenend.org.uk>
 
 	* dselect/pkgdepcon.cc (packagelist::deppossatisfied): The new rule

+ 2 - 0
debian/changelog

@@ -21,6 +21,8 @@ dpkg (1.14.17) UNRELEASED; urgency=low
     Thanks to Sean Finney.
   * Correct broken dselect logic for self-conflicting packages.
     Thanks to Ian Jackson.
+  * Implement 'Breaks' properly in dselect. Closes: #448946
+    Thanks to Ian Jackson.
 
   [ Raphael Hertzog ]
   * Add a warning displayed by dpkg-genchanges if the current version is

+ 2 - 2
dselect/pkgdepcon.cc

@@ -221,7 +221,6 @@ int packagelist::resolvedepcon(dependency *depends) {
 
   case dep_provides:
   case dep_replaces:
-  case dep_breaks: /* FIXME: implement Breaks */
     return 0;
 
   case dep_enhances:
@@ -312,6 +311,7 @@ int packagelist::resolvedepcon(dependency *depends) {
     return r ? 2 : 0;
     
   case dep_conflicts:
+  case dep_breaks:
 
     if (depdebug && debug)
       fprintf(debug,"packagelist[%p]::resolvedepcon([%p]): conflict\n",
@@ -365,7 +365,7 @@ int packagelist::deppossatisfied(deppossi *possi, perpackagestate **fixbyupgrade
     would= 0;
   }
   
-  if (possi->up->type == dep_conflicts
+  if ((possi->up->type == dep_conflicts || possi->up->type == dep_breaks)
       ? possi->up->up != possi->ed && would != 0
       : would > 0) {
     // If it's to be installed or left installed, then either it's of