[SCM] Samba Website Repository - branch master updated

Björn Jacke bjacke at samba.org
Wed May 20 13:53:31 UTC 2020


The branch, master has been updated
       via  320dbdf generated_news.sh: add atom feed generation
       via  9a65a64 link to samba/news.atom feed and add feed icon under the news box
       via  09aca81 fix double </p>
       via  a7e6fd0 add feed logo rss_small.png
      from  e27c430 Add Samba 4.12.3 to the list.

https://git.samba.org/?p=samba-web.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 320dbdf6bd09fb6324d4351e2a1633ff76cd6876
Author: Björn Jacke <bj at sernet.de>
Date:   Wed May 20 15:52:54 2020 +0200

    generated_news.sh: add atom feed generation

commit 9a65a64327180b575d4e5b442e9b594af9c7fa03
Author: Björn Jacke <bj at sernet.de>
Date:   Wed May 20 15:44:32 2020 +0200

    link to samba/news.atom feed and add feed icon under the news box

commit 09aca81a8cf1804c35214fd2dbd226cc7e480699
Author: Björn Jacke <bj at sernet.de>
Date:   Wed May 20 15:29:13 2020 +0200

    fix double </p>

commit a7e6fd0b8a56742990e64638c6861bb75120b12e
Author: Björn Jacke <bj at sernet.de>
Date:   Wed May 20 11:28:25 2020 +0200

    add feed logo rss_small.png

-----------------------------------------------------------------------

Summary of changes:
 generated_news.sh                            |  49 +++++++++++++++++++++++++++
 index.html                                   |   3 +-
 posted_news/20200428-071935.4.12.2.body.html |   1 -
 rss_small.png                                | Bin 0 -> 764 bytes
 4 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 rss_small.png


Changeset truncated at 500 lines:

diff --git a/generated_news.sh b/generated_news.sh
index a8652cd..e0dc7bb 100755
--- a/generated_news.sh
+++ b/generated_news.sh
@@ -38,6 +38,54 @@ generate() {
 	return 0
 }
 
+generate_feed() {
+	local dst="$1"
+	local count="$2"
+	local filter="$3"
+
+	test "${dst}" -nt "posted_news/" && {
+		echo "${dst}: up to date"
+		return 0
+	}
+
+	echo "${dst}: regenerating"
+	files=$(find posted_news/ -type f -regex "${filter}" -printf "%f\n" | sort -r | xargs)
+	{
+		echo '<?xml version="1.0" encoding="utf-8"?>'
+		echo '<feed xmlns="http://www.w3.org/2005/Atom">'
+		echo '<id>https://www.samba.org/samba/news.atom</id>'
+		echo '<link href="https://www.samba.org/samba/news.atom" rel="self"/>'
+		echo '<title>Samba - News</title>'
+		echo '<updated>'`date +%Y-%m-%dT%H:%m:%SZ`'</updated>'
+		echo
+		for f in ${files}; do
+			if [[ "$filter" == *snip* ]] && [[ "$f" == *".body.html"* ]] && [[ "$files" == *"${f%.body.html}.snip.html"* ]]; then
+				continue
+			fi
+			echo '<entry>'
+			MY_UPDATED=`echo $f | sed 's/^\(....\)\(..\)\(..\)-\(..\)\(..\).*/\1-\2-\3T\4:\5:00Z/'`
+			echo "<id>https://www.samba.org/samba/news.atom#$MY_UPDATED</id>"
+			echo "<link rel='alternate' href='https://www.samba.org/samba/latest_news.html'/>"
+			echo '<author><name>Samba Team</name><email>webmaster at samba.org</email></author>'
+			echo "<updated>$MY_UPDATED</updated>"
+
+			cat posted_news/$f \
+				| perl -pe '$/=""; s/<p class=headline>(.*?)<\/p>/<title>$1<\/title>/s' \
+				| grep -v '<h5>' \
+				| grep -v '<!--' \
+				| sed 's:</\?br>:<br />:ig' \
+				| sed "/<\/title>/a <content type='xhtml' xml:base='https:\/\/www.samba.org\/samba\/news.atom'><div xmlns='http:\/\/www.w3.org\/1999\/xhtml'>"
+			echo '</div></content></entry>'
+			count=$((count-1))
+			if [[ $count == 0 ]]; then break; fi
+		done
+		echo '</feed>'
+	} > ${dst}.tmp
+	mv ${dst}.tmp ${dst}
+
+	return 0
+}
+
 generate_latest_stable_release() {
 	local dst="$1"
 	local download_url="$2"
@@ -75,6 +123,7 @@ generate_latest_stable_release() {
 generate "generated_news/latest_10_headlines.html" "10" ".*\.headline\.html"
 generate "generated_news/latest_10_bodies.html" "10" ".*\.body\.html"
 generate "generated_news/latest_2_bodies.html" "2" ".*\.\(snip\|body\)\.html"
+generate_feed "news.atom" "10" ".*\.\(snip\|body\)\.html"
 
 download_url="https://download.samba.org/pub/samba/stable"
 generate_latest_stable_release "generated_news/latest_stable_release.html" "${download_url}"
diff --git a/index.html b/index.html
index be6752a..c2ff3ab 100644
--- a/index.html
+++ b/index.html
@@ -1,6 +1,6 @@
 
   <title>Samba - opening windows to a wider world</title>
-  <link rel="alternate" href="//news.samba.org/feeds/sambanews/" type="application/rss+xml" title="Samba News">
+  <link rel="alternate" href="https://www.samba.org/samba/news.atom" type="application/atom+xml" title="Samba News">
 <!--#include virtual="/samba/global_menu_start.html" -->
 
 <br />
@@ -69,6 +69,7 @@
 
 								<p id="furtherNews">
 									<a href="/samba/latest_news.html">Further News >></a>
+									<a href="news.atom"><img align="right" src="rss_small.png" alt="RSS-Feed"></a>
 								</p>
 							</div>
 							<div class="specialBoxBottom"></div>
diff --git a/posted_news/20200428-071935.4.12.2.body.html b/posted_news/20200428-071935.4.12.2.body.html
index 730c9d9..60ab28f 100644
--- a/posted_news/20200428-071935.4.12.2.body.html
+++ b/posted_news/20200428-071935.4.12.2.body.html
@@ -9,7 +9,6 @@ These are security releases in order to address
 <a href="/samba/security/CVE-2020-10704.html">CVE-2020-10704</a>
 (LDAP Denial of Service (stack overflow) in Samba AD DC).
 </p>
-</p>
 <p>
 The uncompressed tarballs have been signed using GnuPG (ID 6F33915B6568B7EA).
 The 4.12.2 source code can be <a
diff --git a/rss_small.png b/rss_small.png
new file mode 100644
index 0000000..1679ab0
Binary files /dev/null and b/rss_small.png differ


-- 
Samba Website Repository



More information about the samba-cvs mailing list