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)
Fri, Nov 8, 7:02 PM
Unknown Object (File)
Fri, Nov 8, 6:59 AM
Unknown Object (File)
Fri, Nov 8, 5:58 AM
Unknown Object (File)
Thu, Nov 7, 9:12 PM
Unknown Object (File)
Sat, Nov 2, 3:19 PM
Unknown Object (File)
Fri, Oct 25, 1:55 PM
Unknown Object (File)
Tue, Oct 22, 5:57 AM
Unknown Object (File)
Oct 10 2024, 2:56 AM

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.