[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r19969: {translation} we do not need to commit empty files (translation/trunk/tools/gsoc09)



Author: runa
Date: 2009-07-10 08:37:32 -0400 (Fri, 10 Jul 2009)
New Revision: 19969

Modified:
   translation/trunk/tools/gsoc09/po2wml.sh
Log:
we do not need to commit empty files

Modified: translation/trunk/tools/gsoc09/po2wml.sh
===================================================================
--- translation/trunk/tools/gsoc09/po2wml.sh	2009-07-10 11:45:51 UTC (rev 19968)
+++ translation/trunk/tools/gsoc09/po2wml.sh	2009-07-10 12:37:32 UTC (rev 19969)
@@ -82,8 +82,19 @@
 		then
 			if [ -e "$wmldir/$indir/$wmlfile" ]
 			then
-				# Add it to the repository
-				svn add "$wmldir/$indir/$wmlfile"
+				# Check if the po file actually has any
+				# content.
+				content=`cat "$file" | grep '^#[.]' | wc -l`
+
+				# If the po file has some content, add
+				# the resulting wml file to the
+				# repository, if not - delete it.
+				if [ $content != 0 ] 
+				then
+					svn add "$wmldir/$indir/$wmlfile"
+				else
+					rm -f "$wmldir/$indir/$wmlfile"
+				fi
 			fi
 		fi