diff options
author | Colin Watson <cjwatson@debian.org> | 2022-10-15 15:01:16 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-10-15 15:01:16 +0100 |
commit | 175b15a789c92ea810f2d60f51725c44abf31efd (patch) | |
tree | 0ee982dbba89377fba8a27aed49df522f64c9c4a /ChangeLog | |
parent | 8a20bb7f39d2e3d90f2368a2a6b2a1ff8bc5968d (diff) | |
parent | fba1f23672e534ca4bb4d61baf5fb28e9ee5a9da (diff) |
Import man-db_2.11.0.orig.tar.xz
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 990 |
1 files changed, 990 insertions, 0 deletions
@@ -1,3 +1,993 @@ +2022-10-15 Colin Watson <cjwatson@debian.org> + + Release man-db 2.11.0 + +2022-10-13 Colin Watson <cjwatson@debian.org> + + ult_src: Fix possible NULL dereference + + `gcc -fanalyzer` noticed that `canonicalize_file_name` can return NULL, + therefore `find_include` could return NULL, and therefore it was + possible for `ult_src` to attempt to dereference NULL in the `stat + (base, &st)` call. Push more work down to `find_include` so that we can + consistently treat it as an error if it returns NULL. + + * src/ult_src.c (ult_softlink): Move error messages to ... + (gripe_canonicalize_failed): ... here (new function). + (find_include): Replace simple suffix globbing with `comp_file`, and use + this approach in both the relative-to-mantree and + relative-to-dirname-of-page cases; we previously only tried it in the + latter case. Call `gripe_canonicalize_failed` if the final + canonicalization step fails; print a "can't resolve %s" error if we + can't even find anything to canonicalize. + (ult_src): Remove `comp_file` processing, now done by `find_include`. + * src/ult_src.h (gripe_canonicalize_failed): Add prototype. + * src/straycats.c (check_for_stray): Use `gripe_canonicalize_failed`. + +2022-10-11 Colin Watson <cjwatson@debian.org> + + Fix regression in preprocessor string handling + + We need to stop looking for characters that identify preprocessors after + the first space or dash, as otherwise encoding declarations of the kind + specified in man-recode(1) may break. + + * src/man.c (make_roff_command): Only consider the part of the + preprocessor string up to the first space or dash, if any. + +2022-10-11 Colin Watson <cjwatson@debian.org> + + match_in_directory: Split into multiple functions + + `match_in_directory` had two almost entirely disjoint code paths, one + for regex patterns and one for wildcard patterns; but its structure made + it difficult for `gcc -fanalyzer` to understand that, and it was a bit + unclear for humans too. Split it up for clarity. + + * src/globbing.c (match_in_directory): Split out the + regex/wildcard-handling parts to ... + (match_regex_in_directory, match_wildcard_in_directory): ... here, + respectively. + +2022-10-11 Colin Watson <cjwatson@debian.org> + + Assert that another xasprintf call returns non-NULL + + As with commit a22f140354c80a7c5c52c4a413f1c929e105a24c, `gcc + -fanalyzer` notices that `xasprintf` can return NULL in some situations. + I believe those situations would all amount to programming errors here, + so add an assert. + + * src/mandb.c (main): Assert that `xasprintf` returns non-NULL. + +2022-10-09 Colin Watson <cjwatson@debian.org> + + Fix error message + + * src/straycats.c (check_for_stray): If canonicalizing `catdir` returns + NULL, then substitute `catdir` into the "warning: %s is a dangling + symlink" message, not `fullpath` (which at this point must be NULL). + +2022-10-08 Colin Watson <cjwatson@debian.org> + + Convert many more ints to bools + + I don't expect this to make a significant runtime difference, but it + makes some things easier to analyse visually. + + * lib/cleanup.c (do_cleanups_sigsafe): Change `in_sighandler` parameter + type to bool. Update all callers. + (push_cleanup): Change `handler_installed` local variable type to bool. + * lib/cleanup.h (do_cleanups_sigsafe): Update prototype. + * lib/compression.c (comp_info): Change `want_stem` parameter type to + bool. Update all callers. + * lib/compression.h (comp_info): Update prototype. + * lib/sandbox.c (seccomp_filter_unavailable): Change type to bool. + Update all references. + (make_seccomp_filter): Change `permissive` parameter type to bool. + Update all callers. + (_sandbox_load): Likewise. + * lib/util.c (remove_directory): Change `recurse` parameter type to + bool. Update all callers. + * lib/util.h (remove_directory): Update prototype. + * libdb/db_gdbm.c (opening): Change type to bool. Update all + references. + * libdb/db_store.c (compare_ids): Change `promote_links` parameter type + to bool. Update all callers. + * libdb/db_storage.h (compare_ids): Update prototype. + * src/catman.c (parse_for_sec): Change `message` local variable type to + bool. + (check_access): Change return type to bool. + (purge_whatis): Change `cat` parameter type to bool. Update all + callers. + (check_multi_key): Change return type to bool. + * src/descriptions.c (parse_descriptions): Change `seen_base` local + variable type to bool. + * src/globbing.c (look_for_file): Change `cat` parameter type to bool. + Update all callers. + * src/globbing.h (look_for_file): Update prototype. + * src/lexgrog.l (fill_mode, waiting_for_quote): Change types to bool. + Update all references. + * src/man.c (skip, created_tmp_cat): Change types to bool. Update all + references. + (run_mandb): Change `create` parameter type to bool. Update all + callers. + (squeeze_blank_lines): Change `in_blank_line` and `got_blank_line` local + variable types to bool. + (display): Change `format` and `printed` local variable types to bool. + (convert_name): Change `fsstnd` parameter type to bool. Update all + callers. + (add_candidate): Change `dupcand` local variable type to bool. + (main): Change `maybe_section` local variable type to bool. + * src/manp.c (add_sections): Change `user` parameter type to bool. + Update all callers. + (add_def): Likewise. + (add_mandb_map): Likewise. + (add_to_dirlist): Likewise. + (read_config_file): Change `done` local variable type to bool. + (get_manpath_from_path): Change `mandatory` parameter type to bool. + Update all callers. + * src/manp.h (get_manpath_from_path): Update prototype. + * src/whatis.c (do_apropos): Change `matched` local variable type to + bool. + * src/zsoelim.l (no_newline): Change type to bool. Update all + references. + (zsoelim_open_file): Change return type to true. + * src/zsoelim.h (zsoelim_open_file): Update prototype. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Remove unused variable + + * src/man.c (found_a_stray): Remove; it was set but no longer used. + (display_database): Remove setting of `found_a_stray`. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Add some more pure function attributes + + * lib/encodings.c (compatible_encodings): Mark as pure. + * src/man.c (is_section): Likewise. + * src/manp.c (get_config, get_def, get_def_user, is_global_mandir): + Likewise. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Default to --disable-cache-owner on systems without getuid + + * m4/man-arg-cache-owner.m4 (MAN_ARG_CACHE_OWNER): If the system doesn't + have `getuid`, force cache files to have unconstrained cache ownership, + and issue a warning if `--enable-cache-owner` was given. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Fix installation on systems with non-empty EXEEXT + + * src/Makefile.am (install-exec-hook): Add `$(EXEEXT)` to + `chown`/`chmod` calls. + * NEWS.md: Document MinGW portability work. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Fix build on systems without SIGPIPE + + * bootstrap.conf (gnulib_modules): Add sigpipe. + * src/mandb.c (main): Drop `#ifdef SIGPIPE` guards, as Gnulib now + ensures that it's defined. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Fix build on systems without getuid + + * lib/tempfile.c (running_setid): New function; always returns false if + the system doesn't have `getuid`, since in that case we won't have been + able to drop privileges either. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Fix build on systems without <pwd.h> + + * lib/security.h: Only include `<pwd.h>` if `MAN_OWNER` is defined. + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Fix build on systems without <termios.h> + + * bootstrap.conf (gnulib_modules): Add termios. + * src/man.c (get_term): Replace with a no-op stub if the system has no + `<termios.h>` (Gnulib tests for it and can replace some functions, but + its replacement isn't sufficient here). + +2022-10-07 Colin Watson <cjwatson@debian.org> + + Fix build on systems without SIGHUP + + * lib/cleanup.c (trap_abnormal_exits, untrap_abnormal_exits): Guard uses + of `SIGHUP` with an `#ifdef`. + +2022-10-06 Colin Watson <cjwatson@debian.org> + + Run preprocessors in the correct order + + We have no particular reason to trust the order of filters in a + preprocessor string specified in a page; it's easy for authors to get + this wrong by accident. Do as groff(1) does and run them in a + canonicalized order. + + Fixes Debian bug #1012078. + + * src/man.c (add_filter): New function, split out from + `make_roff_command`. + (make_roff_command): Iterate through possible preprocessors and add each + one depending on whether it's present in the preprocessor string, rather + than iterating through the preprocessor string and acting on each of its + characters. Turn several `int` variables into `bool` variables in + passing. + * NEWS.md: Document this. + +2022-10-06 Emir SARI <emir_sari@icloud.com> + + Update Turkish translation + + * po/tr.po: Update from Translation Project. + +2022-10-06 Emir SARI <emir_sari@icloud.com> + + Update Turkish manual page translation + + * man/po4a/po/tr.po: Update from Translation Project. + +2022-10-06 Boyuan Yang <073plan@gmail.com> + + Update Simplified Chinese manual page translation + + * man/po4a/po/zh_CN.po: Update from Translation Project. + +2022-10-06 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org> + + Update Romanian manual page translation + + * man/po4a/po/ro.po: Update from Translation Project. + +2022-10-06 Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org> + + Update Romanian translation + + * po/ro.po: Update from Translation Project. + +2022-10-03 Mario Blättermann <mario.blaettermann@gmail.com> + + Update German manual page translation + + * man/po4a/po/de.po: Update from Translation Project. + +2022-10-02 Colin Watson <cjwatson@debian.org> + + Release man-db 2.11.0-pre1 + +2022-10-02 Colin Watson <cjwatson@debian.org> + + Bump next version to 2.11.0 + + There are quite a few substantial changes here that I think justify an + updated minor number. + + * NEWS.md: Bump to 2.11.0. + +2022-10-02 Colin Watson <cjwatson@debian.org> + + Update translation files + + * po/man-db.pot, po/*.po: Update. + +2022-10-02 Colin Watson <cjwatson@debian.org> + + Fix harmless but incorrect cast + + * libdb/db_xdbm.c (man_xdbm_firstkey): Cast `gl_list_free` to + `gl_mapvalue_dispose_fn`, not `gl_listelement_dispose_fn`. (These were + in practice identical but are semantically distinct.) + +2022-10-02 Colin Watson <cjwatson@debian.org> + + Reformat option declarations using macros + + The previous tabular presentation had some advantages, but it only + looked reasonable in wide terminals, was often quite cumbersome to + maintain, and played poorly with `clang-format`. + + * include/manconfig.h (OPT, OPT_FULL, OPT_ALIAS, OPT_HIDDEN, + OPT_GROUP_HEADER, OPT_HELP_COMPAT): New macros. + * src/accessdb.c (options): Rewrite using `OPT*` macros. + * src/catman.c (options): Likewise. + * src/globbing_test.c (options): Likewise. + * src/lexgrog_test.c (options): Likewise. + * src/man-recode.c (options): Likewise. + * src/man.c (options): Likewise. + * src/manconv_main.c (options): Likewise. + * src/mandb.c (options): Likewise. + * src/manpath.c (options): Likewise. + * src/whatis.c (options): Likewise. + * src/zsoelim_main.c (options): Likewise. + +2022-10-02 Colin Watson <cjwatson@debian.org> + + Add CI checks for Berkeley DB and NDBM + + * .gitlab-ci.yml (build-berkeley-db, build-ndbm): New jobs. + +2022-10-02 Colin Watson <cjwatson@debian.org> + + mandb: Fully reorganize databases + + This allows us to produce bitwise-identical databases regardless of the + order in which pages were scanned (at least with GDBM). + `gdbm_reorganize` isn't enough for this, probably because entries end up + in different positions in hash buckets depending on insertion order; but + reading in the entire database and writing it back out in sorted order + seems to do the job with negligible cost. + + Fixes Debian bug #1010957. + + * src/mandb.c (reorganize): New function: read all the items from a + database in sorted order and write them back out. + (mandb): Stop calling `MYDBM_REORG`, which saved space after deletions + but didn't help with reproducibility. + (process_manpath): Call `reorganize` if any changes were made to a + database. + * libdb/mydbm.h (MYDBM_REORG): Remove macro. + * NEWS.md: Document this. + +2022-10-02 Colin Watson <cjwatson@debian.org> + + mandb: Rearrange database path operations + + Moving these into "methods" of `struct dbpaths` makes the control flow + clearer by avoiding lots of inlined `#ifdef`s. + + I fixed a possible crash in `mandb -f` in the process, exposed by the + clearer control flow. + + * src/mandb.c (dbpaths_init, dbpaths_copy_to_tmp, dbpaths_remove_tmp): + New functions. + (finish_up): Rename to ... + (dbpaths_rename_from_tmp): ... this. + (do_chown): Rename to ... + (dbpaths_chown_if_possible): ... this. + (cleanup_sigsafe): Rename to ... + (dbpaths_unlink_tmp): ... this, and take a `struct dbpaths *` argument + rather than `void *`. + (cleanup): Rename to ... + (dbpaths_free_elements): ... this, and take a `struct dbpaths *` + argument rather than `void *`. + (mandb, process_manpath): Use new `dbpaths_*` functions. Only call + `dbpaths_rename_from_tmp` if `run_mandb` is set (in practice this was + always true anyway but this makes it clearer). Only call + `dbpaths_chown_if_possible` if `run_mandb` is set and + `dbpaths_rename_from_tmp` was called (this may have caused a crash in + some edge cases involving `mandb -f`). + +2022-10-01 Colin Watson <cjwatson@debian.org> + + test_manfile: Remove "already exists" check + + This produced inconsistent results in some unusual cases. For example, + if `/usr/share/man/man5/inetd.conf.5.gz` was a symlink to + `/usr/share/man/man8/inetd.8.gz` and had `NAME` entries for both `inetd` + and `inetd.conf`, then if `inetd.8.gz` was scanned first we would + include a `WHATIS_MAN` entry in section 8 for `inetd.conf`, while if + `inetd.conf.5.gz` was scanned first we'd skip that due to hitting the + already-exists check when scanning `inetd.8.gz`. + + This was originally a performance optimization. Now that we cache the + results of `ult_src` and `find_name`, this optimization no longer helps + us much, so it can go. + + * src/check_mandirs.c (test_manfile): Don't return early if the page + already exists with matching details. + * NEWS.md: Document this. + +2022-10-01 Colin Watson <cjwatson@debian.org> + + Further improve name selection for whatis targets + + In commit 9aff3c30b0, I used the rule "first name in the trace out of + those that have the best ID". However, a better rule turns out to be to + pick the last entry in the trace that has the same section and extension + as the starting page. This is already guaranteed to have at least as + good an ID as the starting page, and since whatis pointers don't include + the target section and extension we need to ensure that they don't cross + sections/extensions; otherwise we just end up with database entries that + man(1) refuses to use, which isn't particularly useful. + + * src/descriptions_store.c (store_descriptions): Parse and cache all the + filenames in the trace at the start. Use the last entry in the trace + with the same section/extension as the starting page as the pointer for + `WHATIS_*` entries. + +2022-10-01 Colin Watson <cjwatson@debian.org> + + test_manfile: Stop caching ult_src traces + + Now that `test_manfile` always calls `ult_src` before adding database + entries, there's no need for it to cache the resulting traces, and doing + so had some confusing consequences since `store_descriptions` could end + up seeing cached traces that didn't include the initial path. + + * src/check_mandirs.c (struct whatis): Remove `trace` element. + (whatis_free): Stop freeing `whatis->trace`. + (test_manfile): Stop caching `ult->trace`; pass it directly to + `store_descriptions` instead. + +2022-10-01 Colin Watson <cjwatson@debian.org> + + Restructure ult_src to add caching + + * src/ult_src.c (struct ult_key): New structure. + (ult_key_new, ult_key_equals, ult_key_hash, ult_key_free, ult_value_new, + ult_value_free): New functions. + (ult_cache): New map. + (ult_src): Instead of returning a path as a string and taking `trace` as + an output parameter, return a `struct ult_value *` containing both path + and trace. Cache the return value in a hash map (indexed by a composite + key consisting of `name` and `flags`), and return cached values where + possible rather than repeating the same work. Update all callers to + reflect the new signature. + * src/ult_src.h (struct ult_value): New structure. + (ult_src): Update prototype. + + * src/check_mandirs.c (test_manfile): Simplify `ult_src` calling + arrangements now that repeated calls with the same `name` and `flags` + arguments are cheap. At the moment this may end up doing a little more + work in some rare cases (links to already-scanned pages with `.so` + links), but that doesn't seem to be very significant at the moment, and + caching could be improved inside `ult_src` if it proves to be a problem. + * src/descriptions_store.c (store_descriptions): `trace` is now always + set. Add an assertion of this and drop a couple of conditionals. + +2022-09-25 Colin Watson <cjwatson@debian.org> + + ult_src: Remove recursion + + The use of recursion for `.so` handling in `ult_src` is somewhat + inconvenient, and it's relatively easy to convert it to an iterative + implementation. + + There should be no functional change from this commit, except to some + details of debug messages. + + * src/ult_src.c (find_include_directive): New function, extracted from + `ult_src`. + (ult_src): Handle `.so` links using a loop rather than recursion. Check + for compression extensions towards the end of the loop rather than at + the beginning, to avoid nonexistent files showing up in the trace. + +2022-09-25 Colin Watson <cjwatson@debian.org> + + 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. + +2022-09-25 Colin Watson <cjwatson@debian.org> + + Don't skip adding a database entry due to SO_MAN + + An existing `SO_MAN` entry shouldn't stop us considering a page for + insertion into the database, because until we run `ult_src` we don't yet + know whether that page will be `ULT_MAN` (which should replace the + existing entry) or `SO_MAN` (which shouldn't). + + * src/check_mandirs.c (test_manfile): Don't return early due to an + existing matching `SO_MAN` entry, but only due to an `ULT_MAN` entry. + * NEWS.md: Document this. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Fix section/extension for whatis entries in database + + * src/descriptions_store.c (store_descriptions): Use the + section/extension of the best name for whatis entries, since we don't + have anything better. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + store_descriptions: Improve debugging + + * src/descriptions_store.c (store_descriptions): Log the extension of + each entry being stored. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Extend database entry replacement rules + + These rules were previously ambiguous such that the targets of whatis + entries depended on the order in which files were scanned. + + * libdb/db_store.c (enum replace_action): Add. + (replace_if_necessary): Extend rules for greater stability. We now also + take mtimes and pointers into account, as well as including a case for + when the new ID is weaker than the old one (there was already a case for + when it was stronger). + (dbstore): Use `replace_if_necessary` when considering replacing multi + keys. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Fix section/extension for links in database + + In some cases this resulted in spurious database entries. For example, + if `man5/inetd.conf.5` was a symlink to `man8/inetd.8` and that page had + a `NAME` entry for `inetd`, then as well as entries for `inetd` in + section 8 and `inetd.conf` in section 5, we would also store a spurious + entry for `inetd` in section 5. We no longer do that. + + * src/descriptions_store.c (store_descriptions): For names corresponding + to entries in the ultimate source trace and not to the base name of the + file, use the section and extension of the trace entry rather than of + the ultimate source. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Pick a more consistent name for whatis targets + + We don't want the targets of whatis entries in the database to depend on + the order in which files were scanned. Prefer the first name in the + trace out of those that have the best ID. + + * src/descriptions_store.c (store_descriptions): Defer adding names that + don't appear in the ultimate source trace (i.e. whatis entries) until we + know the best name to use as the target, and use that best name as the + pointer for each of them. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Fix stored ID for links + + Database entries for links were often incorrectly stored as `ULT_MAN`, + depending on the exact order in which pages were scanned. They are now + stored more consistently as `SO_MAN`. + + * src/descriptions_store.c (store_descriptions): Override the ID from + `ULT_MAN` to `SO_MAN` if the name is not the last entry in the trace. + (Previously we overrode from `SO_MAN` to `ULT_MAN` if the name was the + last entry in the trace, but not the converse.) + * NEWS.md: Document this. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Simplify struct mandata memory allocation + + The arrangement where most of the fields of `struct mandata` were + constant pointers into the `addr` field was a bit more memory-efficient, + but it made some kinds of analysis and reorganization very difficult, + and we don't actually need to be quite that frugal about memory. + Reorganize this to allocate each field independently instead. + + * lib/filenames.c (filename_info): Allocate each field independently. + Use Gnulib's `base_name` and `dir_name` functions to parse paths. Stop + setting `info->addr`. + (free_mandata_struct): Free the `ext`, `sec`, `pointer`, `comp`, + `filter`, and `whatis` fields. Stop freeing `addr`. + * lib/filenames.h (struct mandata): Remove `addr`. Make `ext`, `sec`, + `pointer`, `comp`, `filter`, and `whatis` non-`const`. + * libdb/db_lookup.c (split_content): Copy the `ext`, `sec`, `pointer`, + `filter`, `comp`, and `whatis` fields. Stop setting `addr`. + * libdb/db_store.c (make_content): Copy the `pointer`, `comp`, `filter`, + and `whatis` fields. + * src/descriptions_store.c (store_descriptions): Copy `pointer` and + `whatis` fields. + * src/straycats.c (check_for_stray): Copy `comp`, `ext`, `sec`, and + `filter` fields. + + * libdb/db_lookup.c (dblookup): Always free `cont`'s data pointer, since + it's no longer sometimes borrowed. + * libdb/db_store.c (dbstore): Free `cont`'s and `oldcont`'s data + pointers, since they're no longer borrowed. + * src/check_mandirs.c (purge_missing): Free `content`'s data pointer, + since it's no longer borrowed. + + * libdb/db_lookup.c (dblookup_pattern): Stop freeing `info->addr`. + * src/catman.c (parse_for_sec): Stop freeing `entry->addr`. + * src/whatis.c (do_apropos): Stop freeing `info->addr`. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Stop using the addr field of struct mandata + + The `addr` field of `struct mandata` is just intended as an internal + buffer, but some functions were extracting information from it in + complicated ways, which made it difficult to refactor the memory + allocation here. Use different approaches. + + * src/check_mandirs (test_manfile): Calculate `len` using `comp_info`. + This duplicates some of what `filename_info` does, but it's just some + cheap string manipulation, and it expresses what we want in a less + confusing way (the length of the file name with any compression + extension removed). + * src/descriptions_store.c (store_descriptions): Check whether `path` is + a prefix of `trace_name` rather than of `trace_info->addr`. + `trace_info->addr` is always itself a prefix of `trace_name`, so if + `path` is not a prefix of `trace_name` then it can't be a prefix of + `trace_info->addr`. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + is_prefix: Improve parameter naming + + The second parameter doesn't have to be a directory, so stop implying + that in the parameter name. + + * src/descriptions_store.c (is_prefix): Rename `path` to `parent`; rename + `dir` to `child`. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Simplify split_content interface + + Now that `struct mandata` is always allocated on the heap, we might as + well just have `split_content` return a freshly-allocated `struct + mandata` rather than taking a pointer to one as a parameter. + + * libdb/db_lookup.c (split_content): Allocate and return a `struct + mandata`; remove `pinfo` parameter. Update all callers. + * libdb/db_storage.h (split_content): Update prototype. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + Always allocate struct mandata on the heap + + This means we no longer need two slightly different functions for + freeing it. + + * libdb/db_lookup.c (dblookup_pattern): Allocate `struct mandata` on the + heap. Simplify arrangements for adding to the `infos` list. + (dbstore): Allocate `struct mandata` on the heap. + * src/catman.c (parse_for_sec): Likewise. + * src/check_mandirs.c (purge_pointers, purge_missing): Likewise. + * src/straycats.c (check_for_stray): Likewise. + * src/whatis.c (do_apropos): Likewise. + + * lib/filenames.c (free_mandata_elements): Remove function and move its + contents to ... + (free_mandata_struct): ... here, if `pinfo` is set. + * lib/filenames.h (free_mandata_elements): Remove prototype. + +2022-09-24 Colin Watson <cjwatson@debian.org> + + filename_info: Always allocate info->name + + Only one call site has any interest in this being unset (in order to + pass the result to `dbstore`), and even there it's easier for the caller + to deal with unsetting it. Otherwise, it's strictly more convenient if + the structure returned by `filename_info` always includes the name of + the page. + + * lib/filenames.c (filename_info): Remove `req_name` parameter; update + all callers. Always set `info->name` before returning successfully. + * lib/filenames.h (filename_info): Update prototype. + * src/check_mandirs.c (test_manfile): Use `info->name` for + `manpage_base` rather than poking around in `info->addr`. + (count_glob_matches): Remove `name` parameter; update all callers. + * src/descriptions_store.c (store_descriptions): Drop now-unnecessary + check for `trace_info->name`. + * src/man.c (do_global_apropos_section): Build `title` using + `info->name` rather than poking around in `info->addr`. + * src/mandb.c (update_one_file): Drop now-unnecessary check for + `info->name`. + +2022-09-23 Colin Watson <cjwatson@debian.org> + + Reduce indentation in store_descriptions a bit + + * src/descriptions_store.c (store_descriptions): Use an early-continue + construction to save a level of indentation. + +2022-09-23 Colin Watson <cjwatson@debian.org> + + Simplify the filename_info interface + + This interface is a bit less confusing. + + * libdb/db_lookup.c (free_mandata_elements, free_mandata_struct): Move + to ... + * lib/filenames.c (free_mandata_elements, free_mandata_struct): ... + here. + * libdb/db_storage.h (free_mandata_elements, free_mandata_struct): Move + to ... + * lib/filenames.h (free_mandata_elements, free_mandata_struct): ... + here. + + * lib/filenames.c (filename_info): Return a `struct mandata` with the + `addr` element set to the buffer containing the fields, rather than + returning the buffer and taking a pointer to a `struct mandata` as a + parameter. Update all callers. + * lib/filenames.h (filename_info): Update prototype. + +2022-09-23 Colin Watson <cjwatson@debian.org> + + Move manual page file name utilities to lib/ + + * src/filenames.c: Move to ... + * lib/filenames.c: ... here. + * src/filenames.h: Move to ... + * lib/filenames.h: ... here. Update positioning of all includes. + * lib/Makefile.am (libman_la_SOURCES): Add `filenames.c` and + `filenames.h`. + * src/Makefile.am (man_recode_LDADD): Link with `$(LIBMAN)` instead of + `$(LIBMANDB)`. + (lexgrog_SOURCES, man_SOURCES, mandb_SOURCES): Remove `filenames.c` and + `filenames.h`. + * po/POTFILES.in: Rename `src/filenames.c` to `lib/filenames.c`. + + * lib/filenames.c (gripe_bogus_manpage): Remove `quiet < 2` condition. + (filename_info): Add `warn_if_bogus` parameter; only call + `gripe_bogus_manpage` if it is set. Update all callers. + * lib/filename.h (filename_info): Update prototype. + + * libdb/db_storage.h (struct mandata): Move to ... + * lib/filenames.h (struct mandata): ... here. Add includes where + necessary. + +2022-09-23 Colin Watson <cjwatson@debian.org> + + Fix distcheck + + * po/POTFILES.in: Rename `src/compression.c` to `lib/compression.c`. + +2022-09-23 Colin Watson <cjwatson@debian.org> + + Move compression file name utilities to lib/ + + This makes more sense as a home for plain file name manipulation + utilities. I also merged `include/comp_src.h.in` into + `lib/compression.c`, because structure definitions (as opposed to + declarations) don't belong in header files. + + * src/compression.c: Move to ... + * lib/compression.c: ... here. Remove unnecessary `pipeline.h` include. + * src/compression.h: Move to ... + * lib/compression.h: ... here. Update positioning of all includes. + * lib/Makefile.am (libman_la_SOURCES): Add `compression.c` and + `compression.h`. + * lib/README: Add `compression.*`. + * src/Makefile.am (lexgrog_SOURCES, man_SOURCES, man_recode_SOURCES, + mandb_SOURCES): Remove `compression.c` and `compression.h`. + + * include/comp_src.h (comp_list): Move to ... + * lib/compression.c (comp_list): ... here. Update all references. + * include/manconfig.h (struct compression, comp_list): Move to ... + * lib/compression.h (struct compression, comp_list): ... here. Add + includes where necessary. + * Makefile.am (noinst_HEADERS): Remove `include/comp_src.h`. + +2022-09-23 Colin Watson <cjwatson@debian.org> + + Remove infoalloc macro + + It doesn't really pull its weight. + + * libdb/db_lookup.c (dblookup, dblookup_pattern): Call `XZALLOC (struct + mandata)` rather than `infoalloc ()`. + * src/man.c (try_section, do_global_apropos_section): Likewise. + * libdb/db_storage.h (infoalloc): Remove. + +2022-09-19 Colin Watson <cjwatson@debian.org> + + Maintain multi key references in sorted order + + This is a step towards being able to reproduce the same database given + the same manual page tree. + + * bootstrap.conf (gnulib_modules): Add stpcpy. + * libdb/db_lookup.c (name_ext_equals): Remove static; add pure + attribute. + (name_ext_compare): New function. + (list_extensions): Add entries in sorted order. + * libdb/db_storage.h (name_ext_equals, name_ext_compare): Add + prototypes. + * libdb/db_store.c (make_extensions_reference): New function. + (dbstore): When building or updating multi key references, maintain them + in sorted order. + * NEWS.md: Document this. + +2022-09-19 Colin Watson <cjwatson@debian.org> + + Remove some excessive debugging output + + This hasn't been of any practical use for many years. + + * lib/security.c (drop_effective_privs, regain_effective_privs): Remove + debug messages emitted when increasing or decreasing the privilege drop + count. + +2022-08-11 Colin Watson <cjwatson@debian.org> + + Fix use of pointer (address only) after free + + I don't believe this was technically undefined behaviour, since we + didn't actually dereference the dangling pointer, merely compared its + value (the pointer address itself) against entries in the cleanup stack. + However, the compiler probably had a hard time proving that, so the + use-after-free warning issued by recent versions of GCC seems fair + enough. + + * src/mandb.c (cleanup): Don't free dbpaths. + (process_manpath): Free it here instead, after calling pop_cleanup. + +2022-08-11 Colin Watson <cjwatson@debian.org> + + Make CATWIDTH override MINCATWIDTH/MAXCATWIDTH + + Otherwise setting `CATWIDTH` to something larger than 80 confusingly + doesn't work unless you also set `MAXCATWIDTH`. + + Fixes https://gitlab.com/cjwatson/man-db/-/issues/9. + + * src/man.c (add_roff_line_length): Skip terminal width range check if + `cat_width` is set. + * man/man5/manpath.man5 (FORMAT): Remove note that `CATWIDTH` should be + within the range set by `MINCATWIDTH` and `MAXCATWIDTH`, and instead say + that it overrides them. + * NEWS.md: Document this. + +2022-07-22 Colin Watson <cjwatson@debian.org> + + Add more case variants of localized versions of NAME + + * src/lexgrog.l (bg_name, lt_name, ru_name, sr_name, srlatin_name, + tr_name, uk_name, vi_name): Add more case variants. + * NEWS.md: Document this. + +2022-07-18 Colin Watson <cjwatson@debian.org> + + Update pre-commit hooks + + * .pre-commit-config.yaml (pre-commit-hooks): Update to v4.3.0. + +2022-07-18 Colin Watson <cjwatson@debian.org> + + Update to Gnulib 20220717 + + Fixes https://gitlab.com/cjwatson/man-db/-/issues/6. + + * bootstrap: Sync to Gnulib df336dc1ae60d8ad9f452f2234951133fe617bb0. + * bootstrap.conf (GNULIB_REVISION): Set to + df336dc1ae60d8ad9f452f2234951133fe617bb0. + * NEWS.md: Document build fix. + +2022-07-15 Colin Watson <cjwatson@chiark.greenend.org.uk> + + Merge branch 'drop-lsm' into 'main' + + Drop LSM file + + See merge request cjwatson/man-db!4 + +2022-07-13 Pino Toscano <toscano.pino@tiscali.it> + + Drop LSM file + + The LSM format is a very old format for software, and it is dead for + many years already. Since keeping the .lsm up-to-date is basically not + much of use, simply drop it altogether. + + * docs/Makefile.am (dist_noinst_DATA): Remove man-db.lsm. + * docs/HACKING.md: Stop mentioning man-db.lsm. + * docs/man-db.lsm: Remove file. + +2022-07-05 Stéphane Aulery <lkppo@free.fr> + + Update French manual page translation + + * man/po4a/po/fr.po: Update from Translation Project. + +2022-06-02 Joe Hansen <joedalton2@yahoo.dk> + + Update Danish translation + + * po/da.po: Update from Translation Project. + +2022-05-18 Colin Watson <cjwatson@debian.org> + + Cache filters alongside whatis information + + `mandb` needs to cache filters together with whatis information, as + otherwise pages were incorrectly recorded with no filters if `mandb` + happened to use cached whatis information for them rather than reading + it from scratch. + + * src/check_mandirs.c (struct whatis): Add filters. + (whatis_free): Free whatis->filters. + (test_manfile): Store and use whatis->filters. + * NEWS.md: Document this. + +2022-04-27 Andika Triwidada <andika@gmail.com> + + Update Indonesian translation + + * po/id.po: Update from Translation Project. + * man/THANKS: Add translator credit. + +2022-04-23 Colin Watson <cjwatson@debian.org> + + Stop GitLab from getting confused about licences + + GitLab uses https://github.com/licensee/licensee to detect the project's + licence, and if that finds multiple matching files then it throws up its + hands and refuses to make a licence assertion, with no apparent way to + override it. + + To avoid this problem, move the secondary licence files (those that + apply only to some files, rather than to the project as a whole) back + into a subdirectory, so that `licensee` doesn't notice them. + + * COPYING.GPLv2: Move to ... + * docs/COPYING.GPLv2: ... here. Update all references. + * COPYING.LIB: Move to ... + * docs/COPYING.LIB: ... here. Update all references. + * Makefile.am (dist_noinst_DATA): Remove COPYING.GPLv2. + * docs/Makefile.am (dist_noinst_DATA): Add COPYING.GPLv2 and + COPYING.LIB. + +2022-04-23 Colin Watson <cjwatson@debian.org> + + Clarify effective GPLv3 licensing + + While man-db's own files are individually licensed under GPLv2 (or in a + few cases LGPLv2.1), the project as a whole is effectively GPLv3 due to + Gnulib. This was already explained in README.md, but make it a bit + clearer by having the top-level COPYING file be a copy of GPLv3. + + * COPYING: Move to ... + * COPYING.GPLv2: ... here. + * COPYING: New file. + * Makefile.am (dist_noinst_DATA): Add COPYING.GPLv2. + * lib/README, man/it/man1/apropos.man1, man/it/man1/man.man1, + man/it/man1/manpath.man1, man/it/man1/whatis.man1, + man/it/man1/zsoelim.man1, man/it/man5/manpath.man5, + man/it/man8/accessdb.man8, man/it/man8/catman.man8, + man/it/man8/mandb.man8, man/man1/apropos.man1, man/man1/lexgrog.man1, + man/man1/man-recode.man1, man/man1/man.man1, man/man1/manconv.man1, + man/man1/manpath.man1, man/man1/whatis.man1, man/man1/zsoelim.man1, + man/man5/manpath.man5, man/man8/accessdb.man8, man/man8/catman.man8, + man/man8/mandb.man8, manual/comp.me, manual/db.me, manual/files.me, + manual/format.me, manual/glossary.me, manual/intro.me, manual/leader.me, + manual/man_db.me, manual/misc.me, manual/sec.me: Refer to COPYING.GPLv2 + rather than COPYING. + +2022-04-23 Colin Watson <cjwatson@debian.org> + + Update pre-commit hooks + + * .pre-commit-config.yaml (pre-commit-hooks): Update to v4.2.0. + +2022-04-17 Emir SARI <emir_sari@icloud.com> + + Update Turkish manual page translation + + * man/po4a/po/tr.po: Update from Translation Project. + * man/THANKS: Update translator credit. + +2022-04-16 Colin Watson <cjwatson@debian.org> + + Recognize another Turkish translation of NAME + + Emir SARI reports that "AD" is the de facto standard technical + terminology for "NAME" in Turkish, rather than "İSİM" which sounds + slightly colloquial. Recognize it as well. + + * src/lexgrog.l (tr_name): Add "AD". + +2022-04-12 Emir SARI <emir_sari@icloud.com> + + Update Turkish translation + + * po/tr.po: Update from Translation Project. + * man/THANKS: Add translator credit. + 2022-03-17 Colin Watson <cjwatson@debian.org> Release man-db 2.10.2 |