[GRASS-SVN] r55152 - grass-addons/tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 21 18:30:13 PST 2013
Author: hamish
Date: 2013-02-21 18:30:13 -0800 (Thu, 21 Feb 2013)
New Revision: 55152
Modified:
grass-addons/tools/module_svn_propset.sh
Log:
deal with dos .bat files
Modified: grass-addons/tools/module_svn_propset.sh
===================================================================
--- grass-addons/tools/module_svn_propset.sh 2013-02-21 20:20:37 UTC (rev 55151)
+++ grass-addons/tools/module_svn_propset.sh 2013-02-22 02:30:13 UTC (rev 55152)
@@ -5,7 +5,7 @@
# AUTHOR: Hamish Bowman, Dunedin, New Zealand
# PURPOSE: Looks at the files you pass it, tries to set svn props
# automatically for the ones it knows
-# COPYRIGHT: (c) 2009 Hamish Bowman, and the GRASS Development Team
+# COPYRIGHT: (c) 2009-2013 Hamish Bowman, and the GRASS Development Team
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
# for details.
@@ -36,11 +36,21 @@
fi
}
+set_msdos_eol()
+{
+ if [ `svn propget svn:eol-style "$1"` = "native" ] ; then
+ svn propdel svn:eol-style "$1"
+ fi
+ if [ `svn proplist "$1" | grep -c 'svn:eol-style'` -eq 0 ] ; then
+ svn propset svn:eol-style "CRLF" "$1"
+ fi
+}
+
set_mime_type()
{
# remove generic default for images
if [ `echo "$2" | cut -f1 -d/` = "image" ] ; then
- if [ "`svn propget svn:mime-type "$1"`" = "application/octet-stream" ] ; then
+ if [ `svn propget svn:mime-type "$1"` = "application/octet-stream" ] ; then
svn propdel svn:mime-type "$1"
fi
fi
@@ -135,6 +145,14 @@
#? set_exe "$1"
}
+apply_bat_script()
+{
+ # CHECKME: setting as an app/ might stop trac from trying diffs & previews
+ set_mime_type "$1" "application/x-msdos-program"
+ set_msdos_eol "$1"
+ unset_exe "$1"
+}
+
apply_C_code()
{
set_mime_type "$1" text/x-csrc
@@ -223,6 +241,9 @@
pl)
apply_perl_script "$FILE"
;;
+ bat)
+ apply_bat_script "$FILE"
+ ;;
html)
apply_html "$FILE"
;;
More information about the grass-commit
mailing list