diff options
author | Colin Watson <cjwatson@debian.org> | 2022-09-25 01:31:43 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-09-25 01:31:43 +0100 |
commit | 64c29673370e2875cda661eacb631c69e04fe7af (patch) | |
tree | 7ccfc511cdf1b6539a2c2374541276a7fa002544 | |
parent | 8fe549986ccefff52762933c5a6a9238abfa0ea2 (diff) |
mandb: Improve debugging
* src/check_mandirs.c (test_manfile): Log the file under consideration
on entry. Log when we return early due to an existing database entry.
Remove some unnecessary parentheses from debug messages.
* src/ult_src.c (ult_src): Remove leading newline from debug message.
-rw-r--r-- | src/check_mandirs.c | 7 | ||||
-rw-r--r-- | src/ult_src.c | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/check_mandirs.c b/src/check_mandirs.c index a5046678..dd51e122 100644 --- a/src/check_mandirs.c +++ b/src/check_mandirs.c @@ -168,6 +168,8 @@ void test_manfile (MYDBM_FILE dbf, const char *file, const char *path) gl_list_t ult_trace = NULL; const struct whatis *whatis; + debug ("\ntest_manfile: considering %s\n", file); + memset (&lg, 0, sizeof (struct lexgrog)); info = filename_info (file, quiet < 2); @@ -209,6 +211,7 @@ void test_manfile (MYDBM_FILE dbf, const char *file, const char *path) info->comp ? info->comp : "-") == 0) { if (timespec_cmp (exists->mtime, info->mtime) == 0 && exists->id == ULT_MAN) { + debug ("test_manfile: already exists\n"); free_mandata_struct (exists); free_mandata_struct (info); return; @@ -251,7 +254,7 @@ void test_manfile (MYDBM_FILE dbf, const char *file, const char *path) if (!ult) { /* already warned about this, don't do so again */ - debug ("test_manfile(): bad link %s\n", file); + debug ("test_manfile: bad link %s\n", file); free_mandata_struct (info); return; } @@ -262,7 +265,7 @@ void test_manfile (MYDBM_FILE dbf, const char *file, const char *path) whatis = gl_map_get (whatis_map, ult); if (!whatis) { if (!STRNEQ (ult, file, len)) - debug ("\ntest_manfile(): link not in cache:\n" + debug ("test_manfile: link not in cache:\n" " source = %s\n" " target = %s\n", file, ult); /* Trace the file to its ultimate source, otherwise we'll be diff --git a/src/ult_src.c b/src/ult_src.c index 407360f3..b0a7cc19 100644 --- a/src/ult_src.c +++ b/src/ult_src.c @@ -257,7 +257,7 @@ const char *ult_src (const char *name, const char *path, free (base); base = xstrdup (name); - debug ("\nult_src: File %s in mantree %s\n", name, path); + debug ("ult_src: File %s in mantree %s\n", name, path); /* If we don't have a buf, allocate and assign one */ if (!buf && ((flags & SOFT_LINK) || (flags & HARD_LINK))) { |