After migrating my company from a CVSNT server which ran on Windows to a CVS server that runs on Linux, and thinking everything went fine, I suddenly received a complaint about binary files checking out as ascii, which cause them to break.
after an investiation, I found that CVSNT has a slightly differnt repository version than the what CVS is using.
specifically, CVSNT uses “kopt b” to specify a binary file, while CVS is using “expand @b@;”.
once this was clear, I wrote this little script, that fixes all the “broken” files (files that have kopen b and does not have expand @b”), and add the “expand @b@” line to the.

before you use it, backup your repository.
for each “file,v” the script is modifying, a new backup file named “file,v.bak” is created, and the original file is fixed.
after you fix your repository make sure to tell your users to update all the binary files.


find . -not -name "*,v.bak" -exec grep -q "kopt.*b" \{\} \; -not -exec grep -q "expand.*@b@;" \{\} \; -print0  | xargs -0 -i sh -c  "echo conv {};cp \"{}\" \"{}.bak\";cat \"{}.bak\" | sed 2a\"expand  @b@;\" > \"{}\""