Page MenuHomeFreeBSD

doc tools/books*py: improve argument handling of DOC_LANG, and others
ClosedPublic

Authored by ceri on Jun 11 2021, 3:54 PM.
Tags
Referenced Files
Unknown Object (File)
Jan 15 2024, 7:00 PM
Unknown Object (File)
Jan 14 2024, 10:54 PM
Unknown Object (File)
Jan 12 2024, 1:37 AM
Unknown Object (File)
Dec 23 2023, 2:58 AM
Unknown Object (File)
Oct 31 2023, 2:11 AM
Unknown Object (File)
Aug 2 2023, 5:29 PM
Unknown Object (File)
Jul 1 2023, 11:06 AM
Unknown Object (File)
Jun 12 2023, 4:40 AM
Subscribers

Details

Summary
  1. fix shebang lines;
  2. add a -o option that makes no changes but prints the files that would be updated/created;
  3. allow the -l argument (and therefore DOC_LANG) to be whitespace separated, comma separated, or a mixture of both
Test Plan
  1. chmod +x ./tools/books-toc-creator.py; ./tools/books-toc-creator.py -l en
  1. python3 ./tools/books-toc-creator.py -o -l en,es,hu
  1. python3 ./tools/books-toc-creator.py -l en,fr de ja el,it python3 ./tools/books-toc-creator.py -l en,fr de ja el,it -o zh-cn

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ceri requested review of this revision.Jun 11 2021, 3:54 PM
ceri created this revision.

missed gnu_getopts in two files.

Adding blackend as we had discussed the DOC_LANG separators some weeks ago.

This kind of option remembers something with verbose and dry run options.

I've tested here and this seems fine.

Out of curiosity, is this for help debugging Makefile changes/improvements?

Out of curiosity, is this for help debugging Makefile changes/improvements?

The DOC_LANG restores previous behaviour documented in make.conf (or share/examples/make.conf, I can’t check at the moment) and white space separated variables are arguably easier to work with in make.

The -o option is a start at reintroducing proper dependency tracking, so that the python targets can stop being .PHONY and incremental builds can come back.

In D30732#691069, @ceri wrote:

Out of curiosity, is this for help debugging Makefile changes/improvements?

The DOC_LANG restores previous behaviour documented in make.conf (or share/examples/make.conf, I can’t check at the moment) and white space separated variables are arguably easier to work with in make.

The -o option is a start at reintroducing proper dependency tracking, so that the python targets can stop being .PHONY and incremental builds can come back.

Right.
Thanks for the information.

This revision is now accepted and ready to land.Jun 12 2021, 12:08 PM