From: Martin Kletzander Date: Wed, 26 Jul 2017 15:04:37 +0000 (+0200) Subject: docs: Add build timestamps to generated html/php pages X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a54c9622860;p=libvirt.git docs: Add build timestamps to generated html/php pages In order not to make the build even less reproducible, honour SOURCE_DATE_EPOCH environment variable as specified: https://reproducible-builds.org/specs/source-date-epoch/ Signed-off-by: Martin Kletzander --- diff --git a/docs/Makefile.am b/docs/Makefile.am index e32758f4aa..a5bff7de1c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -196,6 +196,13 @@ MAINTAINERCLEANFILES = \ $(addprefix $(srcdir)/,$(dot_php)) \ $(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc +timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \ + then \ + date --date="@$$SOURCE_DATE_EPOCH"; \ + else \ + date; \ + fi)" + all-am: web api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml @@ -255,7 +262,8 @@ MAINTAINERCLEANFILES += \ $(MKDIR_P) $$dir; \ style=subsite.xsl; \ fi; \ - $(XSLTPROC) --stringparam pagename $$name --nonet \ + $(XSLTPROC) --stringparam pagename $$name \ + --stringparam timestamp $(timestamp) --nonet \ $(top_srcdir)/docs/$$style $< > $@ \ || { rm $@ && exit 1; }; fi @@ -270,9 +278,10 @@ MAINTAINERCLEANFILES += \ else echo "missing XHTML1 DTD"; cat $< > $(srcdir)/$@ ; fi ; fi %.php.tmp: %.php.in site.xsl page.xsl - @if [ -x $(XSLTPROC) ] ; then \ + if [ -x $(XSLTPROC) ] ; then \ echo "Generating $@"; \ - $(XSLTPROC) --stringparam pagename $(@:.tmp=) --nonet \ + $(XSLTPROC) --stringparam pagename $(@:.tmp=) \ + --stringparam timestamp $(timestamp) --nonet \ $(top_srcdir)/docs/site.xsl $< > $@ \ || { rm $@ && exit 1; }; fi @@ -289,6 +298,7 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP) $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ --stringparam builddir '$(abs_top_builddir)' \ + --stringparam timestamp $(timestamp) \ $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \ if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \ if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \ @@ -299,7 +309,8 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP) $(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl) $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ - $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \ + $(XSLTPROC) --stringparam timestamp $(timestamp) \ + --nonet -o $(srcdir)/devhelp/ \ $(top_srcdir)/docs/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; fi diff --git a/docs/newapi.xsl b/docs/newapi.xsl index 9dd961507a..d45bfc192d 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -818,6 +818,7 @@ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + @@ -834,6 +835,7 @@ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + diff --git a/docs/page.xsl b/docs/page.xsl index 1d662c6706..5d8e6e8263 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -75,11 +75,15 @@ + This file is autogenerated from .in Do not edit this file. Changes will be lost. + + This page was generated at . + diff --git a/docs/site.xsl b/docs/site.xsl index ce354c32fb..b84630e390 100644 --- a/docs/site.xsl +++ b/docs/site.xsl @@ -29,6 +29,7 @@ + diff --git a/docs/subsite.xsl b/docs/subsite.xsl index 108d0d83e5..6d2453f98e 100644 --- a/docs/subsite.xsl +++ b/docs/subsite.xsl @@ -19,6 +19,7 @@ +