1#! bash -f
2#----------------------------------------------------------------------------
3# Project:  TwlSDK - tools
4# File:     conv2svnDir.sh
5#
6# Copyright 2007 Nintendo. All rights reserved.
7#
8# These coded instructions, statements, and computer programs contain
9# proprietary information of Nintendo of America Inc. and/or Nintendo
10# Company Ltd., and are protected by Federal copyright law. They may
11# not be disclosed to third parties or copied or duplicated in any form,
12# in whole or in part, without the prior written consent of Nintendo.
13#
14# $Date:: 2007-07-31#$
15# $Rev: 387 $
16# $Author: terui $
17#----------------------------------------------------------------------------
18
19#----------------------------------------------------------------------------
20# Check arguments
21#----------------------------------------------------------------------------
22if [ -z $1 ];
23then
24	input_name="."
25else
26	input_name=$1
27fi
28if [ ! -d $input_name ];
29then
30	echo -e "\"$input_name\" is not directory."
31	exit -1
32fi
33
34#----------------------------------------------------------------------------
35# Search files in directory and convert header string
36#----------------------------------------------------------------------------
37for file_kind in *.txt *.html *.c *.h *.l *.y *.rsf *.lsf *.lcf *.template *.pl *.sh makefile* Makefile* commondefs* modulerules* @* _*
38do
39	for file in `find $input_name -name "$file_kind"`
40	do
41		if [ `expr match $file .*/\.svn/.*` = 0 -a `expr match $file .*/CVS/.*` = 0 ];
42		then
43			echo -e "converting -> $file"
44			perl -s conv2svnFormat.pl $file
45		fi
46	done
47done
48