Page MenuHomeFreeBSD

freebsd-update: improve mandoc db generation
ClosedPublic

Authored by emaste on Apr 4 2021, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 6:45 PM
Unknown Object (File)
Mon, Nov 25, 6:41 PM
Unknown Object (File)
Mon, Nov 25, 12:26 PM
Unknown Object (File)
Fri, Nov 22, 9:19 PM
Unknown Object (File)
Nov 18 2024, 4:44 PM
Unknown Object (File)
Nov 18 2024, 4:24 PM
Unknown Object (File)
Nov 18 2024, 12:00 PM
Unknown Object (File)
Nov 8 2024, 7:02 PM

Details

Summary

@bdrewery reported a concern with mandoc db generation in D10482. I am not sure exactly what happened, but it does appear that the logic will fail if there is no existing mandoc.db to compare against with find -newer.

$ test -z "$(find . -type f -newer /does/not/exist)" && echo true
find: /does/not/exist: No such file or directory
true

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste requested review of this revision.Apr 4 2021, 8:40 PM
emaste created this revision.
emaste added subscribers: cperciva, secteam.

Unmodified 12.2-p1 to 12.2-p5

root@freebsd-update-12:~ # freebsd-update install
src component not installed, skipped
Installing updates...Scanning //usr/share/certs/blacklisted for certificates...
Scanning //usr/share/certs/trusted for certificates...
Scanning //usr/local/share/certs for certificates...
find: ///usr/share/man/mandoc.db: No such file or directory
find: ///usr/share/openssl/man/mandoc.db: No such file or directory
 done.
root@freebsd-update-12:~ # find /usr/share -name mandoc.db
root@freebsd-update-12:~ #

With this patched head version installed as /usr/sbin/freebsd-update:

root@freebsd-update-12:~ # freebsd-update install
src component not installed, skipped
Installing updates...Scanning //usr/share/certs/blacklisted for certificates...
Scanning //usr/share/certs/trusted for certificates...
Scanning //usr/local/share/certs for certificates...
 done.
root@freebsd-update-12:~ # find /usr/share -name mandoc.db
/usr/share/openssl/man/mandoc.db
/usr/share/man/mandoc.db
root@freebsd-update-12:~ #

Unmodified 12.2-p1 to 12.2-p5
...
With this patched head version installed as /usr/sbin/freebsd-update:
...

Both of these were run after deleting mandoc.db from a a fresh 12.2-p1, i.e. find / -name mandoc.db -print -delete

This revision is now accepted and ready to land.Apr 5 2021, 2:57 PM
This revision was automatically updated to reflect the committed changes.