nautilus/check-FIXME.pl

106 lines
3 KiB
Perl
Raw Normal View History

#!/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 po -prune -false \\) -or \\( -name CVS -prune -false \\) -or \\( -name '*' -and -type f \\) \\) -and ! \\( -name '*~' -or -name '#*' -or -name 'ChangeLog*' -or -name Entries \\) -print`;
Wrote a script to check for files that forget to include <config.h> and * check-config-h.pl: Wrote a script to check for files that forget to include <config.h> and optionally edit to add it. * src/nautilus-zoom-control.c (set_zoom_level): Fixed the bug number in a FIXME. * docs/style-guide.html: Added one more tip. * check-FIXME.pl: Use my newfound Perl knowledge to spruce it up. * components/help/converters/gnome-db2html2/gdb3html.c: * components/help/converters/gnome-db2html2/sect-elements.c: * components/help/converters/gnome-db2html2/sect-preparse.c: * components/help/converters/gnome-db2html2/toc-elements.c: * components/help/converters/gnome-info2html2/html.c: * components/help/converters/gnome-info2html2/main.c: * components/help/converters/gnome-info2html2/parse.c: * components/help/converters/gnome-info2html2/utils.c: * components/help/converters/gnome-man2html2/gnome-man2html.c: * components/help/hyperbola-filefmt.c: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * components/help/hyperbola-nav-tree.c: * components/html/glibwww-callbacks.c: * components/html/glibwww-init.c: * components/html/glibwww-trans.c: * components/html/gnome-dialogs.c: * components/html/ntl-web-browser.c: * components/services/install/eazel-install-metadata.c: * components/services/install/eazel-install-protocols.c: * components/services/install/eazel-install-rpm-glue.c: * components/services/install/eazel-install-tests.c: * components/services/install/eazel-install-utils.c: * components/services/install/eazel-install-xml-package-list.c: * components/services/install/eazel-install.c: * components/services/install/helixcode-install-utils.c: * components/services/startup/eazel-register.c: * components/websearch/ntl-web-search.c: * helper-utilities/authenticate/nautilus-authenticate-fork.c: * helper-utilities/authenticate/nautilus-authenticate-pam.c: * helper-utilities/authenticate/nautilus-authenticate.c: * libnautilus-extensions/nautilus-bonobo-extensions.c: * libnautilus-extensions/nautilus-file-utilities.c: * libnautilus-extensions/nautilus-glib-extensions.c: * libnautilus-extensions/nautilus-link.c: * libnautilus-extensions/nautilus-mime-type.c: * libnautilus-extensions/nautilus-undo-transaction.c: * librsvg/art_rgba.c: * librsvg/art_rgba_svp.c: * librsvg/rsvg-bpath-util.c: * librsvg/rsvg-path.c: * librsvg/rsvg.c: * librsvg/test-rsvg.c: * nautilus-widgets/nautilus-caption-table.c: * nautilus-widgets/nautilus-password-dialog.c: * nautilus-widgets/nautilus-preferences-box.c: * nautilus-widgets/nautilus-preferences-dialog.c: * nautilus-widgets/nautilus-preferences-group.c: * nautilus-widgets/nautilus-preferences-item.c: * nautilus-widgets/nautilus-preferences-pane.c: * nautilus-widgets/nautilus-radio-button-group.c: * nautilus-widgets/test-nautilus-widgets.c: * nautilus-widgets/test-preferences.c: * src/file-manager/desktop-item.c: * src/file-manager/desktop-layout.c: * src/file-manager/desktop-menu.c: * src/nautilus-bookmarks-window.c: * src/nautilus-gconf.c: * src/nautilus-window-menus.c: * src/nautilus-window-toolbars.c: * src/nautilus-zoom-control.c * src/nautilus-zoomable-frame-svr.c: * src/ntl-app.c: * src/ntl-content-view.c: * src/ntl-main.c: * src/ntl-meta-view.c: * src/ntl-miniicon.c: * src/ntl-uri-map.c: * src/ntl-view-frame-svr.c: * src/ntl-view.c: * src/ntl-window-state.c: Added includes of <config.h>.
2000-05-02 00:50:32 +00:00
%skip_files =
(
Added HACKING to the files to skip. * check-FIXME.pl: Added HACKING to the files to skip. * components/services/install/idl/trilobite-eazel-install.idl: * components/services/install/lib/eazel-install-corba-callback.c: (impl_install_failed), (impl_uninstall_failed), (eazel_install_callback_query): * components/services/install/lib/eazel-install-corba-types.c: (corba_packagedatastruct_from_packagedata), (packagedata_from_corba_packagedatastruct): * components/services/install/lib/eazel-install-corba.c: (impl_Eazel_Install_query): * components/services/install/lib/eazel-install-protocols.c: (eazel_install_fetch_package), (eazel_install_fetch_package_which_provides), (get_url_for_package), (get_search_url_for_package): * components/services/install/lib/eazel-install-rpm-glue.c: (eazel_install_do_rpm_transaction_save_report), (eazel_install_fetch_rpm_dependencies), (eazel_uninstall_upward_traverse), (eazel_uninstall_downward_traverse): * components/services/install/lib/eazel-install-types.c: (packagedata_destroy_foreach): * src/file-manager/fm-directory-view.c: (activate_callback): * src/nautilus-window.c: (nautilus_window_realize): Fixed "FIXME bugzilla.eazel.com ###:" formatting to match what check-FIXME.pl looks for. The colon goes after the bug number. And it has to be "bugzilla.eazel.com", not "bug". * libnautilus-extensions/nautilus-directory-async.c: (allow_metafile): Fixed a comment. * libnautilus-extensions/nautilus-drag.c: (nautilus_drag_can_accept_item): Got rid of a fixed FIXME and changed to use nautilus_file_is_directory instead of nautilus_file_get_file_type.
2000-08-02 19:26:39 +00:00
"./HACKING" => 1,
Wrote a script to check for files that forget to include <config.h> and * check-config-h.pl: Wrote a script to check for files that forget to include <config.h> and optionally edit to add it. * src/nautilus-zoom-control.c (set_zoom_level): Fixed the bug number in a FIXME. * docs/style-guide.html: Added one more tip. * check-FIXME.pl: Use my newfound Perl knowledge to spruce it up. * components/help/converters/gnome-db2html2/gdb3html.c: * components/help/converters/gnome-db2html2/sect-elements.c: * components/help/converters/gnome-db2html2/sect-preparse.c: * components/help/converters/gnome-db2html2/toc-elements.c: * components/help/converters/gnome-info2html2/html.c: * components/help/converters/gnome-info2html2/main.c: * components/help/converters/gnome-info2html2/parse.c: * components/help/converters/gnome-info2html2/utils.c: * components/help/converters/gnome-man2html2/gnome-man2html.c: * components/help/hyperbola-filefmt.c: * components/help/hyperbola-nav-index.c: * components/help/hyperbola-nav-search.c: * components/help/hyperbola-nav-tree.c: * components/html/glibwww-callbacks.c: * components/html/glibwww-init.c: * components/html/glibwww-trans.c: * components/html/gnome-dialogs.c: * components/html/ntl-web-browser.c: * components/services/install/eazel-install-metadata.c: * components/services/install/eazel-install-protocols.c: * components/services/install/eazel-install-rpm-glue.c: * components/services/install/eazel-install-tests.c: * components/services/install/eazel-install-utils.c: * components/services/install/eazel-install-xml-package-list.c: * components/services/install/eazel-install.c: * components/services/install/helixcode-install-utils.c: * components/services/startup/eazel-register.c: * components/websearch/ntl-web-search.c: * helper-utilities/authenticate/nautilus-authenticate-fork.c: * helper-utilities/authenticate/nautilus-authenticate-pam.c: * helper-utilities/authenticate/nautilus-authenticate.c: * libnautilus-extensions/nautilus-bonobo-extensions.c: * libnautilus-extensions/nautilus-file-utilities.c: * libnautilus-extensions/nautilus-glib-extensions.c: * libnautilus-extensions/nautilus-link.c: * libnautilus-extensions/nautilus-mime-type.c: * libnautilus-extensions/nautilus-undo-transaction.c: * librsvg/art_rgba.c: * librsvg/art_rgba_svp.c: * librsvg/rsvg-bpath-util.c: * librsvg/rsvg-path.c: * librsvg/rsvg.c: * librsvg/test-rsvg.c: * nautilus-widgets/nautilus-caption-table.c: * nautilus-widgets/nautilus-password-dialog.c: * nautilus-widgets/nautilus-preferences-box.c: * nautilus-widgets/nautilus-preferences-dialog.c: * nautilus-widgets/nautilus-preferences-group.c: * nautilus-widgets/nautilus-preferences-item.c: * nautilus-widgets/nautilus-preferences-pane.c: * nautilus-widgets/nautilus-radio-button-group.c: * nautilus-widgets/test-nautilus-widgets.c: * nautilus-widgets/test-preferences.c: * src/file-manager/desktop-item.c: * src/file-manager/desktop-layout.c: * src/file-manager/desktop-menu.c: * src/nautilus-bookmarks-window.c: * src/nautilus-gconf.c: * src/nautilus-window-menus.c: * src/nautilus-window-toolbars.c: * src/nautilus-zoom-control.c * src/nautilus-zoomable-frame-svr.c: * src/ntl-app.c: * src/ntl-content-view.c: * src/ntl-main.c: * src/ntl-meta-view.c: * src/ntl-miniicon.c: * src/ntl-uri-map.c: * src/ntl-view-frame-svr.c: * src/ntl-view.c: * src/ntl-window-state.c: Added includes of <config.h>.
2000-05-02 00:50:32 +00:00
"./TODO" => 1,
"./aclocal.m4" => 1,
"./check-FIXME.pl" => 1,
"./config.sub" => 1,
"./libtool" => 1,
"./ltconfig" => 1,
"./ltmain.sh" => 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\s*:?\s*bugzilla.eazel.com\s+(\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 numbers:\n\n";
foreach my $line (@no_bug_list)
{
print $line, "\n";
}
}
# list the ones with bugs that are not open
print "\n", scalar(keys %bug_lines), " FIXMEs with bug numbers.\n";
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";
}
}
print "\n";