2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00

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.
This commit is contained in:
Michał Kępień 2025-07-10 11:20:46 +02:00
parent 08814b10a1
commit 25e0fade1c
No known key found for this signature in database
2 changed files with 17 additions and 2 deletions

View 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

View 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" \