The problem I have encountered:
First use "cvs import" to import a web application's WEB-INF module to CVS
On a windows machine, checkout this project using eclipse and make some modifications, then commit changes
Go back to Linux, checkout WEB-INF back to work place under tomcat.home.
Now you will find some weird errors regarding the *.jar files in WEB-INF/lib, sth like "bad LOC signature", because the jar files are corrupted.
The reason is CVS treat binary files and non-binary files differently when "add" and "commit", (also when checkout), you have to tell CVS don't merge or modify binary files to avoid file corruption.
Solution:
1. use " -kb" parameter whenever "add" or "commit" a binary file/directory to CVS repository.
2. use cvswrappers
1)checkout CVSROOT project to any workplace you want.
2)modify the cvswrappers under the workplace /CVSROOT, make it looks like:
#############cvswrappers#########
*.CLASS -k 'b' -m 'COPY'
*.DOC -k 'b' -m 'COPY'
*.EAR -k 'b' -m 'COPY'
*.GIF -k 'b' -m 'COPY'
*.JPG -k 'b' -m 'COPY'
*.PDF -k 'b' -m 'COPY'
*.TAR -k 'b' -m 'COPY'
*.WAR -k 'b' -m 'COPY'
*.ZIP -k 'b' -m 'COPY'
*.avi -k 'b' -m 'COPY'
*.bin -k 'b' -m 'COPY'
*.bz -k 'b' -m 'COPY'
*.bz2 -k 'b' -m 'COPY'
*.class -k 'b' -m 'COPY'
*.doc -k 'b' -m 'COPY'
*.ear -k 'b' -m 'COPY'
*.exe -k 'b' -m 'COPY'
*.gif -k 'b' -m 'COPY'
*.gz -k 'b' -m 'COPY'
*.hqx -k 'b' -m 'COPY'
*.jar -k 'b' -m 'COPY'
*.jpeg -k 'b' -m 'COPY'
*.jpg -k 'b' -m 'COPY'
*.mov -k 'b' -m 'COPY'
*.mp3 -k 'b' -m 'COPY'
*.mpg -k 'b' -m 'COPY'
*.pdf -k 'b' -m 'COPY'
*.png -k 'b' -m 'COPY'
*.ppt -k 'b' -m 'COPY'
*.rpm -k 'b' -m 'COPY'
*.sit -k 'b' -m 'COPY'
*.srpm -k 'b' -m 'COPY'
*.swf -k 'b' -m 'COPY'
*.tar -k 'b' -m 'COPY'
*.tbz -k 'b' -m 'COPY'
*.tgz -k 'b' -m 'COPY'
*.tif -k 'b' -m 'COPY'
*.tiff -k 'b' -m 'COPY'
*.war -k 'b' -m 'COPY'
*.xbm -k 'b' -m 'COPY'
*.xls -k 'b' -m 'COPY'
*.zip -k 'b' -m 'COPY
####################
3) comit changes by: cvs commit cvswrappers
Now all the files with extenstion we specified in this file will be treated as binary(no merge, no keyword expantion, etc) by CVS during "add"/"commit".
Ref:
http://www.idevelopment.info/data/Programming/change_management/unix_cvs/PROGRAMMING_Working_with_Binary_Files.shtml