mirror of
https://git.proxmox.com/git/pve-docs
synced 2025-10-04 21:16:32 +00: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
|
MEDIAWIKI_DEB=${MEDIAWIKI_PACKAGE}_${DOCRELEASE}-${PKGREL}_all.deb
|
||||||
DOC_BUILDDEPS := asciidoc-dblatex, source-highlight, librsvg2-bin
|
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
|
all: index.html
|
||||||
|
|
||||||
@ -81,7 +83,7 @@ INDEX_INCLUDES= \
|
|||||||
man8-index-table.adoc \
|
man8-index-table.adoc \
|
||||||
$(sort $(addsuffix .html, ${MANUAL_PAGES}) ${CHAPTER_LIST})
|
$(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
|
BROWSER?=xdg-open
|
||||||
|
|
||||||
|
@ -300,7 +300,12 @@ sub compile_asciidoc {
|
|||||||
|
|
||||||
$leveloffset = - $doctype;
|
$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;
|
chomp $date;
|
||||||
|
|
||||||
my $attributes = {
|
my $attributes = {
|
||||||
@ -308,6 +313,7 @@ sub compile_asciidoc {
|
|||||||
leveloffset => $leveloffset,
|
leveloffset => $leveloffset,
|
||||||
revnumber => $release,
|
revnumber => $release,
|
||||||
revdate => $date,
|
revdate => $date,
|
||||||
|
'footer-style' => 'revdate',
|
||||||
};
|
};
|
||||||
|
|
||||||
my $mansection = $fileinfo->{mansection}->{$env}->{$infile};
|
my $mansection = $fileinfo->{mansection}->{$env}->{$infile};
|
||||||
|
Loading…
Reference in New Issue
Block a user