Przeglądaj źródła

dpkg: Add debug output on diversions and statoverride database loading

Guillem Jover 12 lat temu
rodzic
commit
1b158222cc
3 zmienionych plików z 7 dodań i 0 usunięć
  1. 1 0
      debian/changelog
  2. 3 0
      src/divertdb.c
  3. 3 0
      src/statdb.c

+ 1 - 0
debian/changelog

@@ -5,6 +5,7 @@ dpkg (1.17.4) UNRELEASED; urgency=low
     get replaced multiple times in maintainer scripts, as we rely on the
     inode numbers being different when checking if the databases need to
     be reloaded. Regression introduced in 1.17.2. Closes: #731524
+  * Add debug output to diversions and statoverride database loading code.
 
  -- Guillem Jover <guillem@debian.org>  Thu, 05 Dec 2013 11:08:49 +0100
 

+ 3 - 0
src/divertdb.c

@@ -79,6 +79,7 @@ ensure_diversions(void)
 		    sb_prev.st_dev == sb_next.st_dev &&
 		    sb_prev.st_ino == sb_next.st_ino) {
 			onerr_abort--;
+			debug(dbg_general, "%s: same, skipping", __func__);
 			return;
 		}
 		sb_prev = sb_next;
@@ -95,8 +96,10 @@ ensure_diversions(void)
 	diversions = NULL;
 	if (!file) {
 		onerr_abort--;
+		debug(dbg_general, "%s: none, reseting", __func__);
 		return;
 	}
+	debug(dbg_general, "%s: new, (re)loading", __func__);
 
 	while (fgets_checked(linebuf, sizeof(linebuf), file, diversionsname) >= 0) {
 		oicontest = nfmalloc(sizeof(struct diversion));

+ 3 - 0
src/statdb.c

@@ -144,6 +144,7 @@ ensure_statoverrides(void)
 		    sb_prev.st_dev == sb_next.st_dev &&
 		    sb_prev.st_ino == sb_next.st_ino) {
 			onerr_abort--;
+			debug(dbg_general, "%s: same, skipping", __func__);
 			return;
 		}
 		sb_prev = sb_next;
@@ -155,8 +156,10 @@ ensure_statoverrides(void)
 
 	if (!file) {
 		onerr_abort--;
+		debug(dbg_general, "%s: none, resetting", __func__);
 		return;
 	}
+	debug(dbg_general, "%s: new, (re)loading", __func__);
 
 	/* If the statoverride list is empty we don't need to bother
 	 * reading it. */