소스 검색

dpkg: Rework dependency problem debug and notices on trigproc()

The dependencies_ok() function already prints adequate debugging
information, there's no point repeating it in the call site.

Add also a notice() in case we end up forcing the dependency.
Guillem Jover 11 년 전
부모
커밋
d3264ed325
2개의 변경된 파일8개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 0
      debian/changelog
  2. 7 11
      src/trigproc.c

+ 1 - 0
debian/changelog

@@ -16,6 +16,7 @@ dpkg (1.17.19) UNRELEASED; urgency=low
   * Fix trigger dependency checks and cycle detection.
     Regression introduced in dpkg 1.17.17.
     Closes: #765434, #765668, #765734, #765781, #765789, #765952
+  * Rework dependency problem debug and notice output on trigger processing.
 
   [ Updated programs translations ]
   * Italian (Milo Casagrande): Closes: #765748

+ 7 - 11
src/trigproc.c

@@ -337,23 +337,19 @@ trigproc(struct pkginfo *pkg)
 				sincenothing = 0;
 
 		ok = dependencies_ok(pkg, NULL, &depwhynot);
-		if (ok == DEP_CHECK_OK) {
-			debug(dbg_triggers, "trigproc %s dependencies satisfied, "
-			      "processing", pkg_name(pkg, pnaw_always));
-		} else if (ok == DEP_CHECK_DEFER) {
-			debug(dbg_triggers, "trigproc %s dependencies unsatisfied, "
-			      "defer processing", pkg_name(pkg, pnaw_always));
+		if (ok == DEP_CHECK_DEFER) {
 			varbuf_destroy(&depwhynot);
-
 			enqueue_package(pkg);
 			return;
 		} else if (ok == DEP_CHECK_HALT) {
-			varbuf_end_str(&depwhynot);
-			debug(dbg_triggers, "trigproc %s dependencies unsatisfied, "
-			      "skipping due to:\n %s",
-			      pkg_name(pkg, pnaw_always), depwhynot.buf);
 			varbuf_destroy(&depwhynot);
 			return;
+		} else if (depwhynot.used) {
+			varbuf_end_str(&depwhynot);
+			notice(_("%s: dependency problems, but processing "
+			         "triggers anyway as you requested:\n%s"),
+			       pkg_name(pkg, pnaw_nonambig), depwhynot.buf);
+			varbuf_destroy(&depwhynot);
 		}
 
 		gaveup = check_trigger_cycle(pkg);