mirror of
git://git.proxmox.com/git/pve-docs.git
synced 2025-03-08 04:58:19 +03:00
export and respect SOURCE_DATE_EPOCH
to improve reproducibility of pve-docs, pve-doc-generator and pve-doc-mediawiki builds, as well as man pages generated by pve-doc-generator when called via dpkg-buildpackage. timestamps embedded in the documentation now always reflect the last changelog entry of the package to which the documentation belongs (pve-docs for html, epub and pdf, individual packages for man pages). Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
4a0cf6f845
commit
b965ad63ad
4
Makefile
4
Makefile
@ -17,6 +17,8 @@ DOC_DEB=${DOC_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
|
||||
MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
|
||||
DOC_BUILDDEPS := asciidoc-dblatex, source-highlight, librsvg2-bin
|
||||
|
||||
export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp)
|
||||
SOURCE_DATE_HUMAN := $(shell date -d "@${SOURCE_DATE_EPOCH}")
|
||||
|
||||
all: index.html
|
||||
|
||||
@ -81,7 +83,7 @@ INDEX_INCLUDES= \
|
||||
man8-index-table.adoc \
|
||||
$(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST})
|
||||
|
||||
ADOC_STDARG=-b $(shell pwd)/asciidoc/pve-html -f asciidoc/asciidoc-pve.conf -a icons -a data-uri -a "date=$(shell date)" -a "revnumber=${DOCRELEASE}"
|
||||
ADOC_STDARG=-b $(shell pwd)/asciidoc/pve-html -f asciidoc/asciidoc-pve.conf -a icons -a data-uri -a "date=${SOURCE_DATE_HUMAN}" -a "revnumber=${DOCRELEASE}" -a footer-style=revdate
|
||||
|
||||
BROWSER?=xdg-open
|
||||
|
||||
|
@ -300,7 +300,12 @@ sub compile_asciidoc {
|
||||
|
||||
$leveloffset = - $doctype;
|
||||
|
||||
my $date = `date`;
|
||||
my $date;
|
||||
if (defined($ENV{SOURCE_DATE_EPOCH})) {
|
||||
$date = `date -d "\@$ENV{SOURCE_DATE_EPOCH}"`;
|
||||
} else {
|
||||
$date = `date`;
|
||||
}
|
||||
chomp $date;
|
||||
|
||||
my $attributes = {
|
||||
@ -308,6 +313,7 @@ sub compile_asciidoc {
|
||||
leveloffset => $leveloffset,
|
||||
revnumber => $release,
|
||||
revdate => $date,
|
||||
'footer-style' => 'revdate',
|
||||
};
|
||||
|
||||
my $mansection = $fileinfo->{mansection}->{$env}->{$infile};
|
||||
|
Loading…
x
Reference in New Issue
Block a user