I'm currently in the process of migrating the contents of one SVN server to another. Long story short, I tried using dos2unix
to convert some line endings, but it ended up messing with a good portion of the revision logs without fixing anything. Now I am unable to create a complete dump file using svnadmin
because of malformed file errors. The files are structured like this:
K (# of chars in following line)
svn:author
V (# of chars in following line)
(author)
K ##
svn:date
V ##
(date)
K ##
svn:log
V (# of chars in following lines)
revision
commit
text
END
The error stems from the number following the last V
being incorrect. So far I have been manually changing the number which involves copying the text, counting the characters somewhere, changing the number, saving, and then running svnadmin dump DIR > dumpfile.dmp
to find the next one. I generally wouldn't mind, but running the svnadmin dump
command takes a little time and I'm going to be running it a lot.
My question is this: is there any way to write a script that will count the number of characters from line 12 to the end of the line before "END" and then replace the number in line 11? I'm relatively new to unix and have investigated awk, sed, etc but haven't found anything sufficient. I realize those are rather unique parameters so anything that would be helpful is a welcome. Is there perhaps a way to list the files where the char count and number do not match? That would speed up my job significantly.
Thanks.
e: spelling