]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not hardcode release date in man pages
authorMichał Kępień <michal@isc.org>
Thu, 10 Jul 2025 09:20:46 +0000 (11:20 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 10 Jul 2025 09:20:46 +0000 (11:20 +0200)
The util/meson-dist-package.sh script hardcodes the date it is run on
into the man pages it creates in the dist tarball.  This causes pkgdiff
to report discrepancies if the util/release-tarball-comparison.sh script
is run on a different day than the one the dist tarball was generated
on.

Fix by using the exact same solution as in BIND 9.20: generating the man
page stubs with a @RELEASE_DATE@ placeholder instead of a specific date
and only replacing that placeholder with a specific date during the
build process.

meson.build
util/meson-dist-package.sh

index 819cfe416e18e75872215ca32023beeade4bc1e6..3b854fb5f937ade88244fdfae202c165d19973d1 100644 (file)
@@ -1632,15 +1632,30 @@ alias_target('system-test-dependencies', system_test_targets)
 
 alias_target('doc-misc', doc_misc_targets)
 
+get_release_date = '''
+import os
+import datetime
+
+changelog_mtime = os.path.getmtime("doc/arm/changelog.rst")
+release_date = datetime.date.fromtimestamp(changelog_mtime)
+print(release_date, end="")
+'''
+
 if doc_opt.allowed()
+    release_date = ''
+    if python.found()
+      release_date = run_command(python, ['-c', get_release_date], check: true).stdout()
+    endif
+
     man_srcconf = man_srcset.apply(config, strict: false)
     foreach man : man_srcconf.sources()
         man_pages += configure_file(
             input: man,
             output: fs.stem(man),
             configuration: {
-                'SYSCONFDIR': sysconfdir,
+                'RELEASE_DATE': release_date,
                 'RUNSTATEDIR': runstatedir,
+                'SYSCONFDIR': sysconfdir,
             },
         )
     endforeach
index 3fb6e56c54f999c1545c98f1d6ff47d041346c38..5ecabaa1b731fe1af80e3c355de9d73548e790a4 100644 (file)
@@ -35,7 +35,7 @@ generate_man_pages() {
     -b man \
     -D "release=${MESON_PROJECT_VERSION}" \
     -D "version=${MESON_PROJECT_VERSION}" \
-    -D "today_fmt=%Y-%m-%d" \
+    -D "today=@RELEASE_DATE@" \
     -d "${MESON_BUILD_ROOT}/dist-man-buildroot" \
     -c "${MESON_SOURCE_ROOT}/doc/man" \
     "${MESON_SOURCE_ROOT}/doc/man" \