From 640d6449a6b242f2a915940fc4f3b39cb5268f96 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 11 Oct 2012 15:49:02 -0700 Subject: [PATCH] remove languages we do not yet support --- scripts/find-lang.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/find-lang.sh b/scripts/find-lang.sh index 315d491..2817c1c 100755 --- a/scripts/find-lang.sh +++ b/scripts/find-lang.sh @@ -97,6 +97,23 @@ while test $# -gt 0 ; do esac done +# remove languages we do not yet support - but give out statistics +find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do + if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then + find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do + echo -n "removing translation $file: " + msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null - + done + rm -rf $TOP_DIR/usr/share/locale/$dir + fi +done +find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do + if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then + echo "removing help translation /usr/share/help/$dir" + rm -rf $TOP_DIR/usr/share/help/$dir + fi +done + find "$TOP_DIR" -type f -o -type l|sed ' s:'"$TOP_DIR"':: '"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3: -- 2.7.4