Przeglądaj źródła

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 lat temu
rodzic
commit
870524717e
1 zmienionych plików z 7 dodań i 5 usunięć
  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;
-    if (fc_depends)
-      thisf = (dependtry >= 4) ? found_forced : found_defer;
     debug(dbg_depcondetail,"      removing possdependee, returning %d",thisf);
     return thisf;
   }
@@ -451,9 +449,6 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
   }
 
 unsuitable:
-  if (fc_depends)
-    thisf = (dependtry >= 4) ? found_forced : found_defer;
-
   debug(dbg_depcondetail, "        returning %d", thisf);
   (*interestingwarnings)++;
 
@@ -612,6 +607,13 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
       debug(dbg_depcondetail,"    found %d",found);
       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",
           found, matched,
           possfixbytrig ? pkg_name(possfixbytrig, pnaw_nonambig) : "-");