summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-06-07 16:28:05 -0400
committerColin Walters <walters@verbum.org>2011-06-07 16:28:05 -0400
commit5c99ebf690f71348612c6fff2f414d045179ebc4 (patch)
tree76a41b7f8bb119ddde84c777ba6d75ac536918bb /misc
parent480dac7364c7c42d977a7a94322a0725c6c5054a (diff)
downloadgobject-introspection-5c99ebf690f71348612c6fff2f414d045179ebc4.tar.gz
misc: rewrite extract-gobject-sources.sh to use gobject-public-headers.txt
Rather than maintaining our own exclusion list, grab the text file generated by commit ab0e9dbfa76e056f875e969c0d7b6e133ec75431 in glib. Also it is now Python for sanity.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/extract-gobject-sources.sh12
-rwxr-xr-xmisc/update-gobject-annotations.py26
2 files changed, 26 insertions, 12 deletions
diff --git a/misc/extract-gobject-sources.sh b/misc/extract-gobject-sources.sh
deleted file mode 100755
index 06183659..00000000
--- a/misc/extract-gobject-sources.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-GLIBDIR=$1
-sources=`ls $GLIBDIR/gobject/*.c $GLIBDIR/gobject/*.h | \
- grep -v 'gobject_trace.h' | \
- grep -v 'stamp-'`
-./g-ir-annotation-tool --extract \
- -DGOBJECT_COMPILATION \
- -I$GLIBDIR \
- -I$GLIBDIR/glib \
- -I$GLIBDIR/gobject \
- -I$GLIBDIR/gmodule \
- $sources
diff --git a/misc/update-gobject-annotations.py b/misc/update-gobject-annotations.py
new file mode 100755
index 00000000..47bd1ed8
--- /dev/null
+++ b/misc/update-gobject-annotations.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+if __name__ == '__main__':
+ srcdir = sys.argv[1]
+ sources = []
+ projname = 'gobject'
+ subdir = os.path.join(srcdir, projname)
+ headersfile = os.path.join(subdir, projname + '-public-headers.txt')
+ f = open(headersfile)
+ line = f.read()
+ f.close()
+ for headername in line.split(' '):
+ headername = headername.strip()
+ sources.append(os.path.join(subdir, headername))
+ for sourcename in os.listdir(subdir):
+ if sourcename.endswith('.c'):
+ sources.append(os.path.join(subdir, sourcename))
+ os.execv('./g-ir-annotation-tool',
+ ['./g-ir-annotation-tool', '--extract', '-DGOBJECT_COMPILATION',
+ '-I' + srcdir,
+ '-I' + os.path.join(srcdir, 'glib'),
+ '-I' + os.path.join(srcdir, 'gobject'),
+ '-I' + os.path.join(srcdir, 'gmodule')] + sources)