Software /
code /
prosody
Changeset
13662:1868a757d16b
tools.dnsregistry: Comment out duplicate error codes
This has previously been done manually after running this script
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Feb 2025 16:26:22 +0100 |
parents | 13661:5a7f042fe05d |
children | 13663:ad72753ef57a |
files | tools/dnsregistry.lua |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/dnsregistry.lua Sat Feb 08 12:55:40 2025 +0100 +++ b/tools/dnsregistry.lua Sun Feb 09 16:26:22 2025 +0100 @@ -19,6 +19,7 @@ local registry_name = registry_mapping[registry.attr.id]; if registry_name then print("\t" .. registry_name .. " = {"); + local duplicates = {}; for record in registry:childtags("record") do local record_name = record:get_child_text("name"); local record_type = record:get_child_text("type"); @@ -37,7 +38,9 @@ elseif registry_name == "types" and record_type and record_code then print(("\t\t[%q] = %d; [%d] = %q;"):format(record_type, record_code, record_code, record_type)) elseif registry_name == "errors" and record_code and record_name then - print(("\t\t[%d] = %q; [%q] = %q;"):format(record_code, record_name, record_name, record_desc or record_name)); + local dup = duplicates[record_code] and "-- " or ""; + print(("\t\t%s[%d] = %q; [%q] = %q;"):format(dup, record_code, record_name, record_name, record_desc or record_name)); + duplicates[record_code] = true; end end print("\t};");