diff options
author | Kim Alvefur <zash@zash.se> | 2025-02-09 16:26:22 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2025-02-09 16:26:22 +0100 |
commit | df27bf0645402fbf63405ffd8f949fb6587c7c26 (patch) | |
tree | 45a3fda004603f7965f3b0bc3086ce6255e3aa73 /tools | |
parent | c1655a181f3e4cf6404fad0d9a82da75e93c5cd9 (diff) | |
download | prosody-df27bf0645402fbf63405ffd8f949fb6587c7c26.tar.gz prosody-df27bf0645402fbf63405ffd8f949fb6587c7c26.zip |
tools.dnsregistry: Comment out duplicate error codes
This has previously been done manually after running this script
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dnsregistry.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/dnsregistry.lua b/tools/dnsregistry.lua index 5a258c1a..fa4296da 100644 --- a/tools/dnsregistry.lua +++ b/tools/dnsregistry.lua @@ -19,6 +19,7 @@ for registry in registries:childtags("registry") do 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 @@ for registry in registries:childtags("registry") do 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};"); |