Page MenuHomeFreeBSD

freebsd-update: improve mandoc db generation
ClosedPublic

Authored by emaste on Apr 4 2021, 8:40 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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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