[FFmpeg-cvslog] [ffmpeg-web] branch master updated. a8ec707 Revert "web: move RSS generation to a seperate shell script"

gitolite ffmpeg-cvslog at ffmpeg.org
Mon Dec 9 01:51:51 CET 2013


The branch, master has been updated
       via  a8ec707a6d181a39a268efcf80c7884494cdefac (commit)
      from  efc358ec113ebc33b7eede9a6e7ac9c5f20154d7 (commit)


- Log -----------------------------------------------------------------
commit a8ec707a6d181a39a268efcf80c7884494cdefac
Author:     Michael Niedermayer <michaelni at gmx.at>
AuthorDate: Mon Dec 9 01:05:53 2013 +0100
Commit:     Michael Niedermayer <michaelni at gmx.at>
CommitDate: Mon Dec 9 01:41:54 2013 +0100

    Revert "web: move RSS generation to a seperate shell script"
    
    This reverts commit f4c4145a82d69a24292df4c02b8b8ebe59c4884f.
    
    Execution of scripts from the git checkout during make is not
    supported currently. The Makefile is subject to security checks
    on the server, these do not extend to external scripts.
    It seems none of the root admins had time until now to extend
    these security checks to external scripts and noone else volunteered
    to fix them either (which isnt that trivial as the checks are shared
    between several projects)
    
    Thus to restore the automated website build on push, this commit
    is reverted
    Better solutions welcome, patches welcome, but dont break the
    website build please, also if you do break it, revert, dont
    just leave it assuming someone else will fix it.

diff --git a/Makefile b/Makefile
index 5fa2882..db2ac28 100644
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,23 @@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS)
 	cat src/template_head1 $<_title src/template_head2 $< \
 	src/template_footer > $@
 
-htdocs/main.rss: htdocs/index.html htdocs/archive.html
-	./rss-gen.sh start $@
-	$(foreach html, $^, ./rss-gen.sh middle $@ $(html);)
-	./rss-gen.sh end   $@
+htdocs/main.rss: htdocs/index.html
+	echo '<?xml version="1.0" encoding="UTF-8" ?>' > $@
+	echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' >> $@
+	echo '<channel>' >> $@
+	echo '    <title>FFmpeg RSS</title>' >> $@
+	echo '    <link>http://ffmpeg.org</link>' >> $@
+	echo '    <description>FFmpeg RSS</description>' >> $@
+	echo '    <atom:link href="http://ffmpeg.org/main.rss" rel="self" type="application/rss+xml" />' >> $@
+	grep '<a *id=".*" *></a><h3>.*20..,.*</h3>' $< | sed 'sX<a *id="\(.*\)" *> *</a> *<h3>\(.*20..\), *\(.*\)</h3>X\
+    <item>\
+        <title>\2, \3</title>\
+        <link>http://ffmpeg.org/index.html#\1</link>\
+        <guid>http://ffmpeg.org/index.html#\1</guid>\
+    </item>\
+X' >> $@
+	echo '</channel>' >> $@
+	echo '</rss>' >> $@
+
 
 .PHONY: all clean
diff --git a/rss-gen.sh b/rss-gen.sh
deleted file mode 100755
index a2edb07..0000000
--- a/rss-gen.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-die() {
-    cat <<EOT >&2
-Usage: $0 <mode> <htdocs/output.rss> [<input.html>]
-
-This utility parses & converts generated FFmpeg news HTML page into RSS format.
-"mode" can be begin, middle, or end. If mode is middle, then input HTML is
-required.
-EOT
-    exit 1
-}
-
-# Sanity checks and parsing command line
-
-MODE=$1
-RSS=$2
-HTML=$3
-
-HTML_NODIR=${HTML##*/}
-
-if test $# -lt 2; then
-    echo 'Too few arguments' >&2
-    die
-elif test $# -gt 3; then
-    echo 'Too many arguments' >&2
-    die
-elif test $MODE = "middle" && test $# -ne 3; then
-    echo 'No HTML specified' >&2
-    die
-fi
-
-if test $MODE = "start"; then
-    cat << EOT > $RSS
-<?xml version="1.0" encoding="UTF-8" ?>
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
-<channel>
-    <title>FFmpeg RSS</title>
-    <link>http://ffmpeg.org</link>
-    <description>FFmpeg RSS</description>
-    <atom:link href="http://ffmpeg.org/main.rss" rel="self" type="application/rss+xml" />
-EOT
-elif test $MODE = "middle"; then
-    grep '<a *id=".*" *></a><h3>.*20..,.*</h3>' $HTML | sed 'sX<a *id="\(.*\)" *> *</a> *<h3>\(.*20..\), *\(.*\)</h3>X\
-    <item>\
-        <title>\2, \3</title>\
-        <link>http://ffmpeg.org/'$HTML_NODIR'#\1</link>\
-        <guid>http://ffmpeg.org/'$HTML_NODIR'#\1</guid>\
-    </item>\
-X' >> $RSS
-elif test $MODE = "end"; then
-    cat << EOT >> $RSS
-</channel>
-</rss>
-EOT
-else
-    echo 'Unknown mode' >&2
-    die
-fi

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

Summary of changes:
 Makefile   |   22 ++++++++++++++++++----
 rss-gen.sh |   59 -----------------------------------------------------------
 2 files changed, 18 insertions(+), 63 deletions(-)
 delete mode 100755 rss-gen.sh


hooks/post-receive
-- 



More information about the ffmpeg-cvslog mailing list