On Sun, May 08, 2016 at 12:33:27PM -0700, Kevin J. McCarthy wrote:
> > I did confirm that there were no conflicts, and the patch applies
> > cleanly to 1.6.1.  I'm composing this e-mail from the patched version
> > now. =8^)
> 
> Thanks a lot for doing this, Derek.  Do you have the script you used for
> this?   I wonder if we should put it somewhere, so external packagers
> and use it on patches if needed.

I did not really use a script, per se.  For the safety check, I used
the following sequence of commands:

$ find . -name "*.[ch]" -exec grep -Ro '\WM_\w\+' {} \; |sed 's/^\W*M_/MUTT_/' 
|sort -u > symbols
$ mv symbols ..
$ cat ../symbols | while read pattern; do echo "$pattern:"; if grep -Rlw 
"$pattern" .; then  echo "Symbol \"$pattern\" is unsafe"; fi; done


Then, to make the changes, I used the perl command posted by Andras:

$ perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print`

Then to generate the diff I used the rather obvious:

$  diff -ur mutt-1.6.1.orig mutt-1.6.1 > patch

I did of course test that the patch applied cleanly to a pristine
third copy of the source.  


-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgpXJcn2jBZZR.pgp
Description: PGP signature

Reply via email to