From: Michał Kępień Date: Thu, 10 Jul 2025 09:20:46 +0000 (+0200) Subject: Do not hardcode release date in man pages X-Git-Tag: v9.21.11~54^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25e0fade1c21a7dad780e7052119d003f1bd8091;p=thirdparty%2Fbind9.git 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. --- diff --git a/meson.build b/meson.build index 819cfe416e1..3b854fb5f93 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 3fb6e56c54f..5ecabaa1b73 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" \