From 25e0fade1c21a7dad780e7052119d003f1bd8091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 10 Jul 2025 11:20:46 +0200 Subject: [PATCH] Do not hardcode release date in man pages 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 | 17 ++++++++++++++++- util/meson-dist-package.sh | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 819cfe416e..3b854fb5f9 100644 --- a/meson.build +++ b/meson.build @@ -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 diff --git a/util/meson-dist-package.sh b/util/meson-dist-package.sh index 3fb6e56c54..5ecabaa1b7 100644 --- a/util/meson-dist-package.sh +++ b/util/meson-dist-package.sh @@ -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" \