nautilus/check-FIXME.pl
Darin Adler b350e0b3ce Added -print as suggested by Morten Welinder <terra@diku.dk>. Added -print
* check-FIXME.pl: Added -print as suggested by Morten Welinder
	<terra@diku.dk>.
	* check-config-h.pl: Added -print and fixed broken message as
	suggested by Morten Welinder <terra@diku.dk>.

	* libnautilus-extensions/nautilus-icon-factory.h:
	* libnautilus-extensions/nautilus-icon-factory.c
	(suffix_is_scalable): Simpler implementation.
	(get_themed_icon_file_path): Look for size-specific version of
	even .svg files. Although not so useful, it's not ridiculous to do so.
	(nautilus_icon_factory_get_icon_for_file): Fixed the twisted logic to
	be less twisted. Also changed the ".svg" extension check to use the
	common function suffix_is_scalable.
	(load_specific_image): Untwist logic here too, and note in the FIXME
	that both the .svg library and gdk-pixbuf are limiting us to file:
	URIs, although the gdk-pixbuf case is fixable without redoing the
	library by just using our utility functions.
	(load_image_for_scaling): Update for new size request structure which
	contains maximum sizes as well as nominal ones.
	(scale_image_and_rectangle), (revise_scale_factors_if_too_big),
	(scale_image_down_if_too_big): New helper functions for scaling.
	(load_image_scale_if_necessary): Take the maximum size into account.
	(get_image_from_cache): Use new size request structure and take the
	maximum size into account.
	(nautilus_icon_factory_get_pixbuf_for_icon): Changed to take maximum
	size parameters and pass them in to the underlying function.
	(icon_cache_key_hash): Include the maximum size in the hash.
	(icon_cache_key_equal): Check the maximum size too.
	(nautilus_icon_factory_get_pixbuf_for_file): Pass new max. size
	parameters to the nautilus_icon_factory_get_pixbuf_for_icon
	function.

	* libnautilus-extensions/nautilus-icon-container.c
	(nautilus_icon_container_update_icon): Pass new max. size
	parameters to the nautilus_icon_factory_get_pixbuf_for_icon
	function.

	* src/file-manager/fm-list-view.c
	(fm_list_view_get_emblem_pixbufs_for_file): Pass new max. size
	parameters to the nautilus_icon_factory_get_pixbuf_for_icon
	function.
2000-05-02 20:04:26 +00:00

108 lines
3.1 KiB
Perl
Executable file

#!/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' \\) -print`;
%skip_files =
(
"./TODO" => 1,
"./aclocal.m4" => 1,
"./check-FIXME.pl" => 1,
"./config.sub" => 1,
"./libtool" => 1,
"./ltconfig" => 1,
"./ltmain.sh" => 1,
"./macros/gnome-fileutils.m4" => 1,
"./macros/gnome-objc-checks.m4" => 1,
"./macros/gnome-vfs.m4" => 1,
"./src/file-manager/desktop-canvas.c" => 1,
"./src/file-manager/desktop-layout.c" => 1,
"./src/file-manager/desktop-window.c" => 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 bugzilla.eazel.com (\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";
}
}