From: Rudolf Polzer Date: Mon, 14 May 2012 14:26:28 +0000 (+0200) Subject: properly keep the RSS files existing when clearing X-Git-Tag: xonotic-v0.7.0~55^2~16 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=52a01fa9119586c01190e40e8c736573f128c4ad;p=xonotic%2Fxonotic.git properly keep the RSS files existing when clearing --- diff --git a/misc/tools/conflict-rss.sh b/misc/tools/conflict-rss.sh index 5ad6d335..f92fd5e3 100755 --- a/misc/tools/conflict-rss.sh +++ b/misc/tools/conflict-rss.sh @@ -28,7 +28,7 @@ to_rss() repo=" in $repo" fi - filename=`echo -n "$name" | tr -c 'A-Za-z0-9' '_'`.xml + filename=`echo -n "$name" | tr -c 'A-Za-z0-9' '_'`.rss outfilename="$outdir/$filename" datetime=`date --rfc-2822` branch=`echo "$branch" | escape_html` @@ -63,6 +63,11 @@ EOF EOF } +clear_rss() +{ + sed -i -e '//,$d' "$1" +} + finish_rss() { cat <>"$1" @@ -77,8 +82,11 @@ fi case "$action" in --init) - rm -rf "$outdir" mkdir -p "$outdir" + for f in "$outdir"/*; do + [ -f "$f" ] || continue + clear_rss "$f" + done ;; --finish) for f in "$outdir"/*; do