浏览代码

dpkg: Let --force-depends rescue the dependency check in all cases

The logic that allowed --force-depends to do its job was embedded
in deppossi_ok_found() but that function is no longer called
when there are no packages matching the architecture restriction
implied by the dependency. Due to the structure of the internal
database this happens only with foreign packages.

Instead of relying on deppossi_ok_found() we move the logic directly
into dependencies_ok(), just at the end of the dependencies checks.

Signed-off-by: Guillem Jover <guillem@debian.org>
Raphaël Hertzog 15 年之前
父节点
当前提交
870524717e
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      src/packages.c

+ 7 - 5
src/packages.c

@@ -348,8 +348,6 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
     }
     }
 
 
     *matched = true;
     *matched = true;
-    if (fc_depends)
-      thisf = (dependtry >= 4) ? found_forced : found_defer;
     debug(dbg_depcondetail,"      removing possdependee, returning %d",thisf);
     debug(dbg_depcondetail,"      removing possdependee, returning %d",thisf);
     return thisf;
     return thisf;
   }
   }
@@ -451,9 +449,6 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
   }
   }
 
 
 unsuitable:
 unsuitable:
-  if (fc_depends)
-    thisf = (dependtry >= 4) ? found_forced : found_defer;
-
   debug(dbg_depcondetail, "        returning %d", thisf);
   debug(dbg_depcondetail, "        returning %d", thisf);
   (*interestingwarnings)++;
   (*interestingwarnings)++;
 
 
@@ -612,6 +607,13 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
       debug(dbg_depcondetail,"    found %d",found);
       debug(dbg_depcondetail,"    found %d",found);
       if (thisf > found) found= thisf;
       if (thisf > found) found= thisf;
     }
     }
+    if (fc_depends) {
+      thisf = (dependtry >= 4) ? found_forced : found_defer;
+      if (thisf > found) {
+        found = thisf;
+        debug(dbg_depcondetail, "  rescued by force-depends, found %d", found);
+      }
+    }
     debug(dbg_depcondetail, "  found %d matched %d possfixbytrig %s",
     debug(dbg_depcondetail, "  found %d matched %d possfixbytrig %s",
           found, matched,
           found, matched,
           possfixbytrig ? pkg_name(possfixbytrig, pnaw_nonambig) : "-");
           possfixbytrig ? pkg_name(possfixbytrig, pnaw_nonambig) : "-");