[ooo-build-commit] .: bin/ooo-news-filter-old

Petr Mladek pmladek at kemper.freedesktop.org
Fri Feb 26 05:49:38 PST 2010


 bin/ooo-news-filter-old |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

New commits:
commit 95b72d96c152753be487da39e2d8c9f55bf6ab8f
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Feb 26 14:48:44 2010 +0100

    Helper script to filter old changes in the news file
    
    * bin/ooo-news-filter-old: This script filters the ooo-build NEWS file to show
      only the changes that are not mentioned in another NEWS file from another
      branch.

diff --git a/bin/ooo-news-filter-old b/bin/ooo-news-filter-old
new file mode 100755
index 0000000..b79b130
--- /dev/null
+++ b/bin/ooo-news-filter-old
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+usage()
+{
+    echo "This script filter the ooo-build NEWS file to show only the changes"
+    echo "that are not mentioned in another NEWS file from another branch."
+    echo
+    echo "Usage: ${0##*/} new_news other_news"
+    echo
+    echo "Parameters:"
+    echo
+    echo "	new_news	news files including some newer changes"
+    echo "	other_news	news file from other ooo-build branch that"
+    echo "			includes some changes from new_news"
+}
+
+if test "$1" = "--help" -o $# -ne 2 ; then
+    usage
+    exit 0;
+fi
+
+new_news="$1"
+other_news="$2"
+
+for file in "$new_news" "$other_news" ; do
+    if test ! -f "$file" ; then
+	echo "Error: the file does not exist: $file"
+	exit 1;
+    fi
+done
+
+# create grep patterns from the other news file
+# do not put there version and section lines; just changes entries
+patterns=`mktemp /tmp/ooo-news-filer-old-XXXXXX`
+grep "^	+ " "$other_news" | \
+    sed -e "s|\#|\\\#|" \
+	-e "s|\[|\\\[|" \
+	-e "s|\]|\\\]|"  >"$patterns"
+
+# print the new log without the old entries
+echo "Filtering - go and have some tee..." 1>&2
+grep -f "$patterns" -v "$new_news"
+
+# remove temporary files
+rm $patterns


More information about the ooo-build-commit mailing list