20 test "${dst}" -nt "posted_news/" && {
21 echo "${dst}: up to date"
25 echo "${dst}: regenerating"
26 files=$(find posted_news/ -type f -regex "${filter}" -printf "%f\n" | sort -r | xargs)
29 if [[ "$filter" == *snip* ]] && [[ "$f" == *".body.html"* ]] && [[ "$files" == *"${f%.body.html}.snip.html"* ]]; then
32 echo "<!--#include virtual=\"/samba/posted_news/${f}\" -->"
34 if [[ $count == 0 ]]; then break; fi
41 generate_latest_stable_release() {
43 local download_url="$2"
45 pushd history >/dev/null
46 ALL_VERSIONS=$(ls samba-*.html | cut -d '-' -f2- | cut -d '.' -f1-3 | sort -t. -k 1,1n -k 2,2n -k 3,3n -u)
47 LATEST_VERSION=$(echo "${ALL_VERSIONS}" | tail -1)
50 echo "LATEST_VERSION: ${LATEST_VERSION}"
52 local tgz="samba-${LATEST_VERSION}.tar.gz"
53 local asc="samba-${LATEST_VERSION}.tar.asc"
54 local release_notes="history/samba-${LATEST_VERSION}.html"
56 test "${dst}" -nt "${release_notes}" && {
57 echo "${dst}: up to date"
61 echo "${dst}: regenerating"
63 echo "<!-- BEGIN: ${dst} -->"
65 echo "<a href=\"${download_url}/${tgz}\">Samba ${LATEST_VERSION} (gzipped)</a><br>"
66 echo "<a href=\"/samba/${release_notes}\">Release Notes</a> ·"
67 echo "<a href=\"${download_url}/${asc}\">Signature</a>"
69 echo "<!-- END: ${dst} -->"
75 generate "generated_news/latest_10_headlines.html" "10" ".*\.headline\.html"
76 generate "generated_news/latest_10_bodies.html" "10" ".*\.body\.html"
77 generate "generated_news/latest_2_bodies.html" "2" ".*\.\(snip\|body\)\.html"
79 download_url="https://download.samba.org/pub/samba/stable"
80 generate_latest_stable_release "generated_news/latest_stable_release.html" "${download_url}"