Remove redundancy: produce news/changelog.html from a template
authorRichard Levitte <levitte@openssl.org>
Sun, 24 Feb 2019 13:12:54 +0000 (14:12 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 28 Feb 2019 14:42:17 +0000 (15:42 +0100)
This templates produces a list of links to release changelogs from a
passed list of release versions.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/web/pull/120)

.gitignore
Makefile
news/changelog.html.tt [moved from news/changelog.html with 89% similarity]

index 51ee8fc80feff4afd18a9364dc370ede3c36007f..8234c266032ec6da791d502c24d57a5ebf3087fc 100644 (file)
@@ -20,6 +20,7 @@ docs/*/man7/*
 community/committers.inc
 docs/faq.inc
 docs/fips.inc
+news/changelog.html
 news/changelog.inc
 news/changelog.txt
 news/cl*.txt
index 5eebcd4e649c64755ad3c248bc47f26a68eb8379..467ed2a33d9ecaa365c1f20d8f4030f6f0b8ce68 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,8 +24,7 @@ SIMPLE = newsflash.inc sitemap.txt \
         docs/faq.inc docs/fips.inc \
         docs/OpenSSLStrategicArchitecture.html \
         docs/OpenSSL300Design.html \
-         news/changelog.inc news/changelog.txt \
-        $(foreach S,$(SERIES),news/cl$(subst .,,$(S)).txt) \
+         news/changelog.html \
         $(foreach S,$(SERIES),news/openssl-$(S)-notes.inc) \
         $(foreach S,$(SERIES),news/openssl-$(S)-notes.html) \
         news/newsflash.inc \
@@ -121,6 +120,10 @@ docs/fips.inc: $(wildcard docs/fips/*) bin/mk-filelist
 news/changelog.inc: news/changelog.txt bin/mk-changelog
        @rm -f $@
        ./bin/mk-changelog <news/changelog.txt >$@
+news/changelog.html: news/changelog.html.tt news/changelog.inc
+       @rm -f $@
+       ./bin/from-tt 'releases=$(SERIES)' $<
+news/changelog.html: $(foreach S,$(SERIES),news/cl$(subst .,,$(S)).txt)
 
 # $(1) = output file, $(2) = source directory in CHECKOUTS
 define mknews_changelogtxt
similarity index 89%
rename from news/changelog.html
rename to news/changelog.html.tt
index fd2c0628836d2de391a22f13845c89fd015b74c1..95097b75248c1bd37aba65499f0e1176d09b7100 100644 (file)
             For other branches, the changelogs are distributed with
             the source, but are also available here:
             <ul>
-              <li><a href="cl102.txt">1.0.2</a></li>
-              <li><a href="cl110.txt">1.1.0</a></li>
+[% FOREACH release IN releases.split('\s+').reverse -%]
+              <li><a href="cl[% release.replace('\.', '') %].txt">[%
+              release %]</a></li>
+[% END -%]
             </ul>
            <!--#include virtual="changelog.inc" -->
          </div>