summaryrefslogtreecommitdiff
path: root/check-FIXME.pl
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-04-12 20:34:37 +0000
committerDarin Adler <darin@src.gnome.org>2000-04-12 20:34:37 +0000
commitbaebdb1ad125e9247e85d558228f07fac93af767 (patch)
tree0f90aa0929e5970ba9caae81337b38110a26c7af /check-FIXME.pl
parent951e7313c66e0d8be29ae30350c3ffefaa0744c7 (diff)
downloadnautilus-baebdb1ad125e9247e85d558228f07fac93af767.tar.gz
This is a new Perl script for searching for FIXME in the code. It reports
* check-FIXME.pl: This is a new Perl script for searching for FIXME in the code. It reports any FIXME that does not have a bug number next to it, or any with a bug number that's not an open bug. * libnautilus/nautilus-bookmark.c: Attached a bug number to a FIXME for script-testing purposes. * docs/architecture.txt: Removed a FIXME. So sue me! * src/file-manager/fm-icon-text-window.c (create_attributes_option_menu): Added a call to gettext since the attribute_labels are now N_ strings. * po/.cvsignore: Ignore the generated files. * libnautilus/nautilus-icon-factory.c: Formatting tweak.
Diffstat (limited to 'check-FIXME.pl')
-rwxr-xr-xcheck-FIXME.pl102
1 files changed, 102 insertions, 0 deletions
diff --git a/check-FIXME.pl b/check-FIXME.pl
new file mode 100755
index 000000000..bf1e368f5
--- /dev/null
+++ b/check-FIXME.pl
@@ -0,0 +1,102 @@
+#!/usr/bin/perl -w
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+
+#
+# Nautilus
+#
+# Copyright (C) 2000 Eazel, Inc.
+#
+# This library 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: Darin Adler <darin@eazel.com>,
+#
+
+# check-FIXME.pl: Search for FIXMEs in the sources and correlate them
+# with bugs in the bug database.
+
+use diagnostics;
+use strict;
+
+# default to all the files starting from the current directory
+my %skip_files;
+if (!@ARGV)
+ {
+ @ARGV = `find -name '*' -and ! \\( -name '*~' -or -name '#*' -or -name 'ChangeLog' -or -name 'Entries' -or -name 'check-FIXME.pl' \\)`;
+ $skip_files{"./TODO"} = 1;
+ $skip_files{"./autogen.sh"} = 1;
+ $skip_files{"./aclocal.m4"} = 1;
+ $skip_files{"./config.sub"} = 1;
+ $skip_files{"./libtool"} = 1;
+ $skip_files{"./ltconfig"} = 1;
+ $skip_files{"./ltmain.sh"} = 1;
+ $skip_files{"./macros/gnome-fileutils.m4"} = 1;
+ $skip_files{"./macros/gnome-objc-checks.m4"} = 1;
+ $skip_files{"./macros/gnome-vfs.m4"} = 1;
+ }
+
+# locate all of the target lines
+my $no_bug_lines;
+my %bug_lines;
+foreach my $file (@ARGV)
+ {
+ chomp $file;
+ next if $skip_files{$file};
+ next unless -T $file;
+ open(FILE, $file) || die "can't open $file";
+ while (<FILE>)
+ {
+ next if !/FIXME/;
+ if (/FIXME bug (\d+)/)
+ {
+ $bug_lines{$1} .= "$file:$.:$_";
+ }
+ else
+ {
+ $no_bug_lines .= "$file:$.:$_";
+ }
+ }
+ close(FILE);
+ }
+
+# list the ones without bug numbers
+if ($no_bug_lines ne '')
+ {
+ my @no_bug_list = sort split /\n/, $no_bug_lines;
+ print "\n", scalar(@no_bug_list), " FIXMEs don't have bug reports:\n\n";
+ foreach my $line (@no_bug_list)
+ {
+ print $line, "\n";
+ }
+ }
+
+# list the ones with bugs that are not open
+sub numerically { $a <=> $b; }
+foreach my $bug (sort numerically keys %bug_lines)
+ {
+ # Check and see if the bug is open.
+ my $page = `wget -q -O - http://bugzilla.eazel.com/show_bug.cgi?id=$bug`;
+ $page =~ tr/\n/ /;
+ my $status = "unknown";
+ $status = $1 if $page =~ m|Status:.*</TD>\s*<TD>([A-Z]+)</TD>|;
+ next if $status eq "NEW" || $status eq "ASSIGNED" || $status eq "REOPENED";
+
+ # This a bug that is not open, so report it.
+ my @bug_line_list = sort split /\n/, $bug_lines{$bug};
+ print "\nBug $bug is $status:\n\n";
+ foreach my $line (@bug_line_list)
+ {
+ print $line, "\n";
+ }
+ }