20 test "${dst}" -nt "posted_news/" && {
21 echo "${dst}: up to date"
25 echo "${dst}: regenerating"
26 files=$(find posted_news/ -type f -name "${filter}" -printf "%f\n" | sort -r | head -${count} | xargs)
29 echo "<!--#include virtual=\"/samba/posted_news/${f}\" -->"
36 generate_latest_stable_release() {
38 local download_url="$2"
40 pushd history >/dev/null
41 ALL_VERSIONS=$(ls samba-*.html | cut -d '-' -f2- | cut -d '.' -f1-3 | sort -t. -k 1,1n -k 2,2n -k 3,3n -u)
42 LATEST_VERSION=$(echo "${ALL_VERSIONS}" | tail -1)
45 echo "LATEST_VERSION: ${LATEST_VERSION}"
47 local tgz="samba-${LATEST_VERSION}.tar.gz"
48 local asc="samba-${LATEST_VERSION}.tar.asc"
49 local release_notes="history/samba-${LATEST_VERSION}.html"
51 test "${dst}" -nt "${release_notes}" && {
52 echo "${dst}: up to date"
56 echo "${dst}: regenerating"
58 echo "<!-- BEGIN: ${dst} -->"
60 echo "<a href=\"${download_url}/${tgz}\">Samba ${LATEST_VERSION} (gzipped)</a><br>"
61 echo "<a href=\"/samba/${release_notes}\">Release Notes</a> ·"
62 echo "<a href=\"${download_url}/${asc}\">Signature</a>"
64 echo "<!-- END: ${dst} -->"
70 generate "generated_news/latest_10_headlines.html" "10" "*.headline.html"
71 generate "generated_news/latest_10_bodies.html" "10" "*.body.html"
72 generate "generated_news/latest_2_bodies.html" "2" "*.body.html"
74 download_url="https://download.samba.org/pub/samba/stable"
75 generate_latest_stable_release "generated_news/latest_stable_release.html" "${download_url}"