ascii type 파일들이 유닉스에서 ^M 표시가 나는 것을 막기 위해 eol-type 설정하는 방법을 확인해보았다.
설치한 계정에 .subversion 디렉토리가 생성되어 있고 그 아래 config 파일을 수정하면 된다.
vi ~/.sunversion/config
[miscellany]
enable-auto-props = yes
[auto-props]
#source file
*.c = svn:eol-style=native; svn:mime-type=text/plain
*.cpp = svn:eol-style=native; svn:mime-type=text/plain
*.pc = svn:eol-style=native; svn:mime-type=text/plain
*.h = svn:eol-style=native; svn:mime-type=text/plain
*.ph = svn:eol-style=native; svn:mime-type=text/plain
*.java = svn:eol-style=native; svn:mime-type=text/plain
*.jsp = svn:eol-style=native; svn:mime-type=text/plain
Makefile = svn:eol-style=native
#executable shell
*.sh = svn:eol-style=native; svn:executable
*.txt = svn:eol-style=native; svn:mime-type=text/plain
#image
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
*.gif = svn:mime-type=image/gif
*.bmp = svn:mime-type=image/bmp
#application
*.pdf = svn:mime-type=application/pdf
*.doc = svn:mime-type=application/msword
*.ppt = svn:mime-type=application/vnd.ms-powerpoint
*.xls = svn:mime-type=application/vnd.ms-excel
*.gz = svn:mime-type=application/gzip
*.tgz = svn:mime-type=application/gzip
*.zip = svn:mime-type=application/zip
*.swf = svn:mime-type=application/x-shockwave-flash
*.rtf = svn:mime-type=text/rtf
# video / audio
*.avi = svn:mime-type=video/avi
*.mov = svn:mime-type=video/quicktime
*.mp3 = svn:mime-type=audio/mpeg
*.wav = svn:mime-type=audio/wav
# web resource
*.js = svn:eol-style=native; svn:mime-type=text/javascript
*.css = svn:eol-style=native; svn:mime-type=text/css
*.dtd = svn:eol-style=native; svn:mime-type=text/xml
*.html = svn:eol-style=native; svn:mime-type=text/html
*.xml = svn:eol-style=native; svn:mime-type=text/xml
*.xsd = svn:eol-style=native; svn:mime-type=text/xml
추가이슈로.. 이미 설정하기 전의 파일들은 일일이 지정해주지 않으면 반영이 안되는것 같다.
그래서 쉘로 돌려보았는데...
set_eol_native.sh
svn update
find . \( -name *.c -o -name *.pc -o -name *.h -o -name *.ph -o -name *.ldt -o -name makefile \) -type f -exec svn propset svn:eol-style native {} \;
find . \( -name *.java -o -name *.jsp -o -name *.properties -o -name *.xml -o -name *.sql -o -name *.dtd -o -name *.tld -o -name *.xsd \) -type f -exec svn propset svn:eol-style native {} \;
find . \( -name *.js -o -name *.css -o -name *.html -o -name *.txt \) -type f -exec svn propset svn:eol-style native {} \;
svn commit -m "prop setting eol-type to native"
약간 곤란한 경우는 저 작업 중간에 conflict 가 나는 경우 -> revert 해서 현행화 하고 다시 돌리기..
또 약간 곤란한 경우는
svn : XXX has inconsistent newlines
svn : Inconsistent line ending style
이라고 나오면서 skip 하는 경우... 뭐 스킵해야 할듯...
이 글은 스프링노트에서 작성되었습니다.