From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH pmg-docs] gen-pmg.conf.5: check key to section mapping only in docs build
Date: Thu, 5 Feb 2026 16:20:24 +0100 [thread overview]
Message-ID: <20260205152029.437975-1-s.ivanov@proxmox.com> (raw)
adding a new option to pmg.conf currently requires updating pmg-docs,
as both are tightly coupled through gen-pmg.conf.pl.
The checks in gen-pmg.conf.pl ensure that most keys (some are
explicitly ignored) are put in a category to be rendered in the fitting
section of the docs.
While ensuring our docs are consistent makes sense, the mutual
dependency of pmg-api and pmg-docs slows down things like `sbuild`, or
rolling out fixes for older releases - as it requires an update of
pmg-docs-generator before upgrading pmg-api.
The patch reverses the logic of:
f475c3f ("gen-pmg.conf.5: allow to overwrite undocumented key error for bootstrapping")
by not dying in the default case. Ensuring that each config key is in
a category happens when building pmg-docs - by setting the
PMG_DOCS_IGNORE_MISSING_KEY explicitly to 0 in the Makefile.
tested by removing an existing key from gen-pmg.conf.5-opts.pl, and
building pmg-api, followed by building pmg-docs, which failed.
the pmg.conf(5) manpage still had the key present.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
Makefile | 2 ++
gen-pmg.conf.5-opts.pl | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 52980a6..6031ef6 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,8 @@ DOC_DEB=$(DOC_PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
SOURCE_DATE_HUMAN := $(shell date -d "@$(SOURCE_DATE_EPOCH)")
+# ensure all pmg.conf keys are accounted for in their respective section.
+export PMG_DOCS_IGNORE_MISSING_KEY ?= 0
all: index.html
diff --git a/gen-pmg.conf.5-opts.pl b/gen-pmg.conf.5-opts.pl
index 3ef9d98..2684719 100755
--- a/gen-pmg.conf.5-opts.pl
+++ b/gen-pmg.conf.5-opts.pl
@@ -75,6 +75,8 @@ my $key_groups = {
}],
};
+my $die_on_missing = !( $ENV{PMG_DOCS_IGNORE_MISSING_KEY} // 1);
+
if (1) {
# verify if we document all mail settings
my $plugin = PMG::Config::Base->lookup('mail');
@@ -98,7 +100,7 @@ if (1) {
next if $k =~ m/^max_(filters|policy|smtpd_in|smtpd_out)$/;
if (!defined($found_mail_keys->{$k})) {
- die "undocumented key '$k'" if !$ENV{PMG_DOCS_IGNORE_MISSING_KEY};
+ die "undocumented key '$k'" if $die_on_missing;
warn "WARNING: undocumented key '$k'\n";
}
}
--
2.47.3
reply other threads:[~2026-02-05 15:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260205152029.437975-1-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox