From f7513e5a80f7b70d8eaa3eb11b51b9fb4bcd5dbc Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 8 Nov 2006 21:42:32 +0000 Subject: [PATCH] added defcheck.py. 2006-11-08 Sven Neumann * tools/Makefile.am (EXTRA_DIST): added defcheck.py. * tools/defcheck.py: keep a list of .def files, glob didn't work for me. Also bail out with a reasonable message if not being called from the toplevel source directory. * Makefile.am (dist-hook): check .def files for consistency. --- ChangeLog | 12 +++++++++++- Makefile.am | 5 ++++- tools/Makefile.am | 1 + tools/defcheck.py | 25 ++++++++++++++++++++----- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03e2c05f5f..416770df87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,17 @@ +2006-11-08 Sven Neumann + + * tools/Makefile.am (EXTRA_DIST): added defcheck.py. + + * tools/defcheck.py: keep a list of .def files, glob didn't work + for me. Also bail out with a reasonable message if not being + called from the toplevel source directory. + + * Makefile.am (dist-hook): check .def files for consistency. + 2006-11-08 Jakub Steiner * stock-tool-foreground-select: update SIOX icon based on feedback - on the mailing list + on the mailing list. 2006-11-08 Kevin Cozens diff --git a/Makefile.am b/Makefile.am index 69d6034933..170867016e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,9 @@ DISTCLEANFILES = \ gimpinstall-@GIMP_TOOL_VERSION@: $(LN_S) $(srcdir)/install-sh $(srcdir)/gimpinstall-@GIMP_TOOL_VERSION@ +check-defs: + @$(PYTHON) tools/defcheck.py || \ + ( echo "* .def files inconsistent *"; exit 1; ) validate-authors: if HAVE_XMLLINT @@ -99,4 +102,4 @@ endif all-local: AUTHORS -dist-hook: validate-authors +dist-hook: check-defs validate-authors diff --git a/tools/Makefile.am b/tools/Makefile.am index 953e9f625e..1c60a59959 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -39,6 +39,7 @@ INCLUDES = \ -I$(includedir) EXTRA_DIST = \ + defcheck.py \ gimp-mkenums \ gimppath2svg.py \ rmshm diff --git a/tools/defcheck.py b/tools/defcheck.py index 72d4fc0eea..2344f6d750 100755 --- a/tools/defcheck.py +++ b/tools/defcheck.py @@ -27,14 +27,31 @@ Needs the tool "nm" to work. """ -import sys, commands, glob +import sys, commands -for df in glob.glob ("lib*/*.def"): +def_files = ( + "libgimpbase/gimpbase.def", + "libgimpcolor/gimpcolor.def", + "libgimpconfig/gimpconfig.def", + "libgimp/gimp.def", + "libgimp/gimpui.def", + "libgimpmath/gimpmath.def", + "libgimpmodule/gimpmodule.def", + "libgimpthumb/gimpthumb.def", + "libgimpwidgets/gimpwidgets.def" +) + +for df in def_files: directory, rest = df.split ("/") basename, extension = rest.split (".") libname = directory + "/.libs/lib" + basename + "-*.so" - defsymbols = file (df).read ().split ()[1:] + try: + defsymbols = file (df).read ().split ()[1:] + except IOError, message: + print message + print "You need to run this script from the toplevel source directory." + sys.exit (-1) doublesymbols = [] for i in range (len (defsymbols)-1, 0, -1): @@ -90,5 +107,3 @@ for df in glob.glob ("lib*/*.def"): sys.exit (1) sys.exit (0) - -