That looks great. I'll test it as soon as I can and give you some feedback.
-- Sylvain On Tue, Dec 07, 2004 at 08:58:58AM -0800, Mark D. Baushke wrote: > Sylvain Beucler <[EMAIL PROTECTED]> writes: > > > On Mon, Dec 06, 2004 at 04:47:56PM -0800, Mark D. Baushke wrote: > > > Sylvain Beucler <[EMAIL PROTECTED]> writes: > > > > > > > Hello, > > > > > > > > I would like to fix a problem that occured at Savannah. The issue is > > > > pretty much described here: > > > > http://lists.gnu.org/archive/html/savannah-hackers/2004-12/msg00061.html > > > > > > > > and to sum up, the logged username became uid##### instead of the > > > > actual username, for a few days about a year ago. For example, user > > > > "miles" became "uid65618": > > > > http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/filecache.el > > > > > > > > The mapping uid<->user can be found using /etc/passwd. > > > > > > > > > > > > We would like to write a script to fix these usernames. However, > > > > rcs(1) is not meant to do it; moreover, the various RCS parser I had a > > > > look at are more concerned about extracting revisions than making > > > > changes to the actual RCS file, when they are not beta versions. > > > > > > > > Various web and mailing list archive searches didn't help. > > > > > > > > What do you think is the best way to fix the RCS files? Of course, > > > > "manual editing" is valid, but I have the failing to expect a quicker > > > > way :) > > > > > > Quicker? Hmmm... > > > > > > find . -name \*,v -print0 \| > > > xargs -0 perl -i.bak -pane \ > > > > > > 's,^(date\s+[0-9.]+;\s+author\s+)uid65618;(\s+state\s\S;$),$1miles;$2,g;' > > > > > > Of course, I urge you to ensure that the repository is locked or > > > otherwise not actively being modified when you run the script. > > > > > > I would suggest performing the initial runs of the script on a snapshot > > > of the repository and then doing a comparison of the .bak files with > > > the original versions to ensure everything looks correct. > > > > Thanks. However, I was looking for a more "secure" way to do the > > job. In the best case, I would like to apply the script to fix ~2000 > > repositories. > > Ahhh, well, that does make a difference. > > > The script you suggest could match a line in the deltas (for example, > > in a file discussing the RCS format) instead of in the administrative > > part. I could stop the substitution when I meet "desc(\s|\n)@", but I > > am afraid of missing that "separator" when parsing a RCS file > > generated by an older version of CVS - hence why I looked for a RCS > > parser. > > Such parsers exist in RCS, CVS, CVSup(d). > > > Moreover, it is difficult to test whether the substitution occured > > properly. > > > > Any idea? > > The following hack to the CVS sources will probably do what you want. > > cvs log > before > cvs admin -guid65618=miles > cvs log > after > diff before after > > I don't know about the advisiblity of making this a feature of CVS, so > unless other folks specify a need for this kind of addition, I probably > won't be incorporating it into a general CVS release. > > Good luck, _______________________________________________ Info-cvs mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/info-cvs
