diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-06 09:42:54 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-06 11:41:42 +0100 |
commit | 7bd5b8614d2bb5602c52af05b637d712fbc0682d (patch) | |
tree | 33c561120743f324c45e6443a0ec84f04c63aba4 /tools | |
parent | ca9fab8896995b1766787b70963ea752cbb68939 (diff) | |
download | systemd-7bd5b8614d2bb5602c52af05b637d712fbc0682d.tar.gz |
update-dbus-docs: say "MODIFIED" not "OUTDATED"
When executed in test mode, "OUTDATED" is appropriate. But when executed
to actually update the text, after the tool executes, those pages are the
opposite, not outdated.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/update-dbus-docs.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/update-dbus-docs.py b/tools/update-dbus-docs.py index b453a0867e..562bfcf1c1 100755 --- a/tools/update-dbus-docs.py +++ b/tools/update-dbus-docs.py @@ -289,7 +289,7 @@ def process(page): with open(page, 'w') as out: out.write(out_text) - return dict(stats=stats, outdated=(out_text != src)) + return dict(stats=stats, modified=(out_text != src)) def parse_args(): p = argparse.ArgumentParser() @@ -317,17 +317,18 @@ if __name__ == '__main__': # Let's print all statistics at the end mlen = max(len(page) for page in stats) total = sum((item['stats'] for item in stats.values()), collections.Counter()) - total = 'total', dict(stats=total, outdated=False) - outdated = [] + total = 'total', dict(stats=total, modified=False) + modified = [] + classification = 'OUTDATED' if opts.test else 'MODIFIED' for page, info in sorted(stats.items()) + [total]: m = info['stats']['missing'] t = info['stats']['total'] p = page + ':' - c = 'OUTDATED' if info['outdated'] else '' + c = classification if info['modified'] else '' if c: - outdated.append(page) + modified.append(page) print(f'{p:{mlen + 1}} {t - m}/{t} {c}') - if opts.test and outdated: - exit(f'Outdated pages: {", ".join(outdated)}\n' + if opts.test and modified: + exit(f'Outdated pages: {", ".join(modified)}\n' f'Hint: ninja -C {opts.build_dir} update-dbus-docs') |