[haiku-commits] r39728 - haiku/trunk/src/tools

Author: mmadia
Date: 2010-12-04 21:01:00 +0100 (Sat, 04 Dec 2010)
New Revision: 39728
Changeset: http://dev.haiku-os.org/changeset/39728

Added:
   haiku/trunk/src/tools/propset-files.sh
Log:
Added a small utility script, to set the svn properties on html files.
This should be run whenever changes are made to HAIKU_TOP docs.


Added: haiku/trunk/src/tools/propset-files.sh
===================================================================
--- haiku/trunk/src/tools/propset-files.sh                              (rev 0)
+++ haiku/trunk/src/tools/propset-files.sh      2010-12-04 20:01:00 UTC (rev 
39728)
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# A quick and dirty script, to help add the svn property to files.
+# It is intended to be ran with a relative path from the desired directory.
+# e.g.,
+# haiku/trunk/docs> sh ../src/tools/propset-files.sh
+
+tmpDir="`finddir B_COMMON_TEMP_DIRECTORY`"
+tmpFile="${tmpDir}/propset-html"
+find . -type d -name .svn -prune -o -print > "$tmpFile"
+
+while read file ; do
+       hasProperty=`svn propget svn:mime-type "$file"`
+
+       if ! [ $hasProperty ] ; then
+               case "$file" in
+                       *.html)
+                               mimetype="text/html"
+                               svn propset svn:mime-type "$mimetype" "$file"
+                               ;;
+                       #*.png)
+                       #       mimetype="image/png"
+                       #       #svn propset svn:mime-type "$mimetype" "$file"
+                       #       ;;
+                       #*)
+                       #       echo $file
+                       #       ;;
+               esac
+       fi
+done < "$tmpFile"
+
+rm "$tmpFile"


Other related posts:

  • » [haiku-commits] r39728 - haiku/trunk/src/tools - mattmadia