[ooo-build-commit] .: 2 commits - bin/fixguard.py

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Mon Oct 4 02:16:20 PDT 2010


 bin/fixguard.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 774e4327a1ba4765211b59ff2ca4a6d0b7d8ffba
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Mon Oct 4 11:15:33 2010 +0200

    Forgot to add execute bit for user on fixguard.py

diff --git a/bin/fixguard.py b/bin/fixguard.py
old mode 100644
new mode 100755
commit f010d7563a235b16c43fa73f0f83f87b6e33891f
Author: Michael <callahan at xmission.com>
Date:   Mon Oct 4 11:09:38 2010 +0200

    Added script to remove the include guards
    
    Here is the basics on how to use it:
    
     python fixguard.py somefile.cxx
    
    Or recursively:
    
     # Go to the clone/writer directory.
     find . -name '*.cxx' -exec grep python $HOME/fixguard.py {} \;
     git diff
     # verify that the diffs are sane and check them in.

diff --git a/bin/fixguard.py b/bin/fixguard.py
new file mode 100644
index 0000000..2b3f98a
--- /dev/null
+++ b/bin/fixguard.py
@@ -0,0 +1,14 @@
+#/usr/bin/python
+import sys
+import re
+
+exp = '#ifndef.*_HXX.*\n(#include.*\n)#endif.*'
+
+filename = sys.argv[1] # warning no error checking
+
+data = open(filename).read()
+
+o = open("/tmp/fixed","w")
+o.write( re.sub(exp,"\\1",data) )
+o.close()
+os.rename("/tmp/fixed", filename)


More information about the ooo-build-commit mailing list