gnumeric r17016 - trunk/tools



Author: mortenw
Date: Sun Dec 14 22:11:49 2008
New Revision: 17016
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17016&view=rev

Log:
2008-12-14  Morten Welinder  <terra gnome org>

	* check-gtk-includes: New program.




Added:
   trunk/tools/check-gtk-includes   (contents, props changed)
Modified:
   trunk/tools/ChangeLog
   trunk/tools/Makefile.am
   trunk/tools/check-gfrees

Modified: trunk/tools/Makefile.am
==============================================================================
--- trunk/tools/Makefile.am	(original)
+++ trunk/tools/Makefile.am	Sun Dec 14 22:11:49 2008
@@ -11,4 +11,4 @@
     gconf_schemas_to_win32_reg_LDADD = $(GNUMERIC_LIBS)
 endif
 
-EXTRA_DIST = dumpdef.pl check-gfrees check-null-false-returns
+EXTRA_DIST = dumpdef.pl check-gfrees check-gtk-includes check-null-false-returns

Modified: trunk/tools/check-gfrees
==============================================================================
--- trunk/tools/check-gfrees	(original)
+++ trunk/tools/check-gfrees	Sun Dec 14 22:11:49 2008
@@ -37,7 +37,7 @@
 
 {
     local (*FIND);
-    open (*FIND, "find . '(' -type f -name '*.c' -print ')' -o '(' -type d '(' -name CVS -o -name intl -o -name macros ')' -prune ')' |")
+    open (*FIND, "find . '(' -type f -name '*.c' -print ')' -o '(' -type d '(' -name CVS -o -name intl -o -name macros -o -name .svn ')' -prune ')' |")
 	or die "$0: cannot execute find: $!\n";
   FILE:
     foreach my $filename (<FIND>) {

Added: trunk/tools/check-gtk-includes
==============================================================================
--- (empty file)
+++ trunk/tools/check-gtk-includes	Sun Dec 14 22:11:49 2008
@@ -0,0 +1,75 @@
+#!/usr/bin/perl -w
+#
+#  Gnumeric
+#
+#  Copyright (C) 2008 Morten Welinder.
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of the
+#  License, or (at your option) any later version.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this library; if not, write to the Free Software
+#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#  Author: Morten Welinder <terra gnome org>
+
+use strict;
+
+my $exitcode = 0;
+my $verbose = 0;
+my $strict = 0;
+
+warn "$0: should be run from top-level directory.\n"
+    unless -r "configure.in" && -r 'ChangeLog';
+
+my %base_exceptions =
+    ();
+
+my %exceptions =
+    ();
+
+{
+    local (*FIND);
+    open (*FIND, "find . '(' -type f -name '*.[ch]' -print ')' -o '(' -type d '(' -name CVS -o -name intl -o -name macros -o -name .svn ')' -prune ')' |")
+	or die "$0: cannot execute find: $!\n";
+  FILE:
+    foreach my $filename (<FIND>) {
+	chomp $filename;
+	$filename =~ s|^\./||;
+
+	next if $exceptions{$filename};
+	my $basename = $filename;
+	$basename =~ s|^.*/||;
+	next if $base_exceptions{$basename};
+
+	local (*FIL);
+	if (open (*FIL, "< $filename")) {
+	    # print STDERR "Checking $filename...\n";
+	    my $lineno = 0;
+	    my @lines;
+	  LINE:
+	    while (<FIL>) {
+		$lineno++;
+
+		if (m'^\s*\#\s*include\s+(<gtk/gtk[a-z].*>)') {
+		    $exitcode = 1;
+		    print STDERR "$0: $filename includes $1\n";
+		}
+	    }
+	    close (*FIL);
+	} else {
+	    print STDERR "$0: Cannot read `$filename': $!\b";
+	    $exitcode = 1;
+	}
+    }
+    close (*FIND);
+}
+
+exit $exitcode;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]