You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/09/08 16:33:00 UTC
svn commit: r812524 - in /incubator/pivot/trunk/project/bin: ./
check-svn-props.sh
Author: tvolkert
Date: Tue Sep 8 14:32:59 2009
New Revision: 812524
URL: http://svn.apache.org/viewvc?rev=812524&view=rev
Log:
Added script to check for SVN properties
Added:
incubator/pivot/trunk/project/bin/
incubator/pivot/trunk/project/bin/check-svn-props.sh (with props)
Added: incubator/pivot/trunk/project/bin/check-svn-props.sh
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/project/bin/check-svn-props.sh?rev=812524&view=auto
==============================================================================
--- incubator/pivot/trunk/project/bin/check-svn-props.sh (added)
+++ incubator/pivot/trunk/project/bin/check-svn-props.sh Tue Sep 8 14:32:59 2009
@@ -0,0 +1,53 @@
+#!/bin/bash
+###
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###
+
+function check-svn-props() {
+ for f in `find . -type f | grep -Ev '(.svn|/\.)'` ; do
+ ## Get the mime type of the file
+ MIME_TYPE=`file -b --mime-type $f`
+
+ ## Extract the main type and subtype
+ INDEX=`expr index "$MIME_TYPE" '/'`
+ TYPE=${MIME_TYPE:0:INDEX - 1}
+ SUBTYPE=${MIME_TYPE:INDEX}
+
+ ## Get for svn:eol-style
+ SVN_EOL_STYLE=`svn pg svn:eol-style $f 2>/dev/null`
+ if [ -z "$SVN_EOL_STYLE" ]; then
+ if [[ "$TYPE" == "text" || "$MIME_TYPE" == "application/xml" ]]; then
+ echo "svn ps svn:eol-style native $f"
+ fi
+ fi
+
+ ## Check for svn:mime-type
+ SVN_MIME_TYPE=`svn pg svn:mime-type $f 2>/dev/null`
+ if [ -z "$SVN_MIME_TYPE" ]; then
+ if [ $MIME_TYPE == "application/xml" ]; then
+ echo "svn ps svn:mime-type application/xml $f"
+ elif [ $MIME_TYPE == "image/png" ]; then
+ echo "svn ps svn:mime-type image/png $f"
+ elif [ $MIME_TYPE == "image/jpeg" ]; then
+ echo "svn ps svn:mime-type image/jpeg $f"
+ elif [ $MIME_TYPE == "image/gif" ]; then
+ echo "svn ps svn:mime-type image/gif $f"
+ fi
+ fi
+ done
+}
+
+check-svn-props
Propchange: incubator/pivot/trunk/project/bin/check-svn-props.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/pivot/trunk/project/bin/check-svn-props.sh
------------------------------------------------------------------------------
svn:executable = *