[Libreoffice] Need a little help with the easyhack "Strip include guards in idl files"

Julien Nabet serval2412 at yahoo.fr
Sat Mar 26 16:20:27 PDT 2011


Hello,


Concerning the easyhack "Strip include guards in idl files", I pushed 2 
patches for the directory "ure/udkapi".

For the first patch I only used the strip-guards script with just a 
change to apply for idl + remove of the "includes" block between the 2 
final "Find".

Then to check it was ok, i used this command to search ifndef line 
followed by include line in idl files :
find . -name "*.idl"|xargs pcregrep -M 'ifndef.*\n.*include'

pcregrep is multiline grep (available for Debian, I don't know for the 
other Linux distribs, MacOs or Windows).

There were few to process manually so I did it and pushed a second patch.


Then I took a look at the directory "ure/offapi". There are about 3700 
files and the strip-guards script lets a lot (more than 3000!) of 
"#ifndef" with "#include".( I don't know why, a pb of Unix/Dos 
end-of-line perhaps ?)
This time it's too much to do it manually.
Some idea to improve the strip-guards script ?


BTW I saw there were idl files in some "test" or "qa" directories of ure 
but I don't think they could cause pb.

Julien.





I know very little of Perl, does anybody got an idea to avoid to process 
3700 files by hand ?

Julien.


More information about the LibreOffice mailing list