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)
Sat, Feb 22, 5:30 PM
Unknown Object (File)
Sun, Feb 16, 7:03 AM
Unknown Object (File)
Sat, Feb 8, 1:37 AM
Unknown Object (File)
Jan 17 2025, 11:33 PM
Unknown Object (File)
Jan 17 2025, 12:14 PM
Unknown Object (File)
Jan 3 2025, 11:32 AM
Unknown Object (File)
Dec 13 2024, 2:54 PM
Unknown Object (File)
Dec 11 2024, 3:58 PM
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