nautilus/check-THANKS.pl
Darin Adler d9195bab4c reviewed by: John Sullivan <sullivan@eazel.com>
Some enhancements to icon lookup.

	* libnautilus-extensions/nautilus-icon-factory.h:
	* libnautilus-extensions/nautilus-icon-factory.c:
	(get_mime_type_icon_without_suffix): Function used to strip suffixes
	out so we can have file suffixes in the gnome-vfs icon database, but
	can ignore them and look at all suffixes for the named icon.
	(make_icon_name_from_mime_type): Construct an icon name for types
	that don't specify a particular icon. This allows theme designers
	to make icons for any MIME type.
	(get_icon_name_for_regular_file): Use the new "without suffix" call.
	This requires changing this function to return a strdup'd name.
	(get_icon_name_for_directory), (get_icon_name_for_file): Change to
	return a strdup'd name.
	(make_full_icon_path): Do the file exists check in here (was
	already doing it in some cases) and also call
	gnome_vfs_icon_path_from_filename.
	(get_themed_icon_file_path): Get rid of redundant g_file_exists
	checks and gnome_vfs_icon_path_from_filename call, since both are
	now handled inside make_full_icon_path.
	(nautilus_scalable_icon_get_text_pieces),
	(nautilus_scalable_icon_new_from_text_pieces),
	(nautilus_scalable_icon_unref), (nautilus_scalable_icon_hash),
	(nautilus_scalable_icon_equal): Add MIME type to the scalable
	icons.
	(nautilus_icon_factory_get_icon_for_file): Pass in the MIME type.
	(nautilus_icon_factory_get_emblem_icon_by_name): Pass NULL for
	MIME type.
	(load_pixbuf_svg): Change to pass in boolean for emblem hack since
	we don't always have an icon name.
	(load_icon_from_path): New function, share common code.
	(load_named_icon): New function, share common code.
	(load_specific_icon): Try icon based on MIME type first, then fall
	back on the name specified.
	(nautilus_icon_factory_get_pixbuf_from_name): Pass NULL for MIME
	type.
	(load_icon_with_embedded_text): Pass in the MIME type.

	* src/nautilus-bookmark-list.c: (append_bookmark_node):
	* src/nautilus-bookmark-parsing.c:
	(nautilus_bookmark_new_from_node):
	* libnautilus-extensions/nautilus-bookmark.c:
	(nautilus_bookmark_icon_is_different),
	(nautilus_bookmark_set_icon_to_default):
	Update to deal with MIME types in scalable icons.

	* components/help/hyperbola-filefmt.c:
	(fmt_scrollkeeper_parse_toc_section),
	(fmt_scrollkeeper_parse_doc_toc),
	(fmt_scrollkeeper_parse_document),
	(fmt_scrollkeeper_parse_section), (fmt_scrollkeeper_parse_xml),
	(fmt_scrollkeeper_trim_empty_branches),
	(fmt_scrollkeeper_tree_empty), (fmt_scrollkeeper_populate_tree),
	(remove_leading_and_trailing_white_spaces), (fmt_toplevel_add_doc),
	(get_path_from_node), (has_content), (fmt_toplevel_parse_xml_tree):
	Made more compatible with libxml by not using the content field
	directly and using xmlChildrenNode and xmlRootNode.

	* libnautilus-extensions/nautilus-trash-monitor.c:
	(nautilus_trash_monitor_get): Fixed NautilusDirectory leak.

	* THANKS: Added some more translator credits.
	* check-THANKS.pl: Fixed some email addresses and such.

	* icons/ardmore/.cvsignore:
	* icons/arlo/.cvsignore,
	* icons/arlo/backgrounds/.cvsignore:
	* icons/arlo/sidebar_tab_pieces/.cvsignore:
	* icons/villanova/.cvsignore:
	Removed these again.
2001-05-01 21:21:09 +00:00

296 lines
7.1 KiB
Perl
Executable file

#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# Nautilus
#
# Copyright (C) 2000, 2001 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: Maciej Stachowiak <mjs@eazel.com>
#
# check-THANKS.pl: Checks for users mentioned in one of the ChangeLogs
# but not in THANKS or AUTHORS; ensure that THANKS and AUTHORS do not
# overlap.
use diagnostics;
use strict;
# Map from alternate names of some users to canonical versions
my %name_map =
(
"Darin as Andy" => "Darin Adler",
"Eskil Olsen" => "Eskil Heyn Olsen",
"J. Shane Culpepper" => "J Shane Culpepper",
"Michael Engber" => "Mike Engber",
"Michael K. Fleming" => "Mike Fleming",
"Pavel Císler" => "Pavel Cisler",
"Pavel" => "Pavel Cisler",
"Rebecka Schulman" => "Rebecca Schulman",
"Robin Slomkowski" => "Robin * Slomkowski",
"Shane Culpepper" => "J Shane Culpepper",
"Szabolcs BAN" => "Szabolcs Ban",
"Takuo KITAME" => "Takuo Kitame",
"arik devens" => "Arik Devens",
);
# Map from alternate email addresses of some users to canonical versions
my %email_map =
(
'almer1@dds.nl' => 'almer@gnome.org',
'arik@gnome.org' => 'arik@eazel.com',
'at@ue-spacy.com' => 'tagoh@gnome.gr.jp',
'baulig@suse.de' => 'martin@home-of-linux.org',
'carlos@gnome-db.org' => 'carlos@hispalinux.es',
'chief_wanker@eazel.com' => 'eskil@eazel.com',
'hp@pobox.com' => 'hp@redhat.com',
'josh@eazel.com' => 'josh@whitecape.org',
'kabalak@gmx.net' => 'kabalak@kabalak.net',
'kabalak@gtranslator.org' => 'kabalak@kabalak.net',
'kmaraas@gnu.org' => 'kmaraas@gnome.org',
'kmaraas@online.no' => 'kmaraas@gnome.org',
'linux@chrisime.de' => 'chrisime@gnome.org',
'linuxfan@ionet..net' => 'josh@whitecape.org',
'linuxfan@ionet.net' => 'josh@whitecape.org',
'mathieu@gnome.org' => 'mathieu@eazel.com',
'mathieu@gnu.org' => 'mathieu@eazel.com',
'mawa@iname.com' => 'mawarkus@gnome.org',
'raph@gimp.org' => 'raph@acm.org',
'rslomkow@rslomkow.org' => 'rslomkow@eazel.com',
'snickell@stanford.edu' => 'seth@eazel.com',
'sopwith@eazel.com' => 'sopwith@redhat.com',
'yakk@yakk.net' => 'ian@eazel.com',
'yakk@yakk.net.au' => 'ian@eazel.com',
);
# Some ChangeLog lines that carry no credit (incorrect changes that
# had to be reverted, changes done for someone else, etc.)
my %no_credit =
(
'2000-09-08 Daniel Egger <egger@suse.de>' => 1,
'2000-09-06 Daniel Egger <egger@suse.de>' => 1,
'2001-04-25 Changwoo Ryu <cwryu@debian.org>' => 1,
);
open CHANGELOGS, "cat `find . -name intl -prune -or -name 'ChangeLog*' -and \! -name '*~' -print`|" or die;
my @lines;
while (<CHANGELOGS>)
{
chomp;
if (/@/)
{
next if $no_credit{$_};
if (/^\d\d\d\d-\d\d-\d\d/)
{
# Normal style ChangeLog comment
s/^\d\d\d\d-\d\d-\d\d[ \t]*//;
}
elsif (/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\d\d\d\d/)
{
# Old style ChangeLog comment
s/^.*20\d\d\s*//;
}
else
{
# FIXME bugzilla.eazel.com 3452: we should also try to extract
# names & addresses from entry body text.
next; # ignore unknown lines for now
}
my $name = $_;
$name =~ s/[ \t]*<.*[\n\r]*$//;
$name = $name_map{$name} if $name_map{$name};
my $email = $_;
$email =~ s/^.*<//;
$email =~ s/>.*$//;
$email =~ s/[ \t\n\r]*$//;
$email =~ s/helixcode/ximian/;
$email = $email_map{$email} if $email_map{$email};
push @lines, "${name} <${email}>";
}
}
close CHANGELOGS;
my @changelog_people;
my $last_line = "";
foreach my $line (sort @lines)
{
push @changelog_people, $line unless $line eq $last_line;
$last_line = $line;
}
open AUTHORS, "AUTHORS" or die;
my @authors;
while (<AUTHORS>) {
chomp;
push @authors, $_;
}
close AUTHORS;
open THANKS, "THANKS" or die;
my @thanks_people;
while (<THANKS>) {
chomp;
s/ - .*$//;
push @thanks_people, $_;
}
close THANKS;
my $found_about_authors = 0;
my @about_authors;
if (open ABOUT, "src/nautilus-window-menus.c")
{
while (<ABOUT>)
{
if (/const char \*authors/)
{
$found_about_authors = 1;
last;
}
}
if ($found_about_authors)
{
while (<ABOUT>)
{
last unless /^\s+\"(.*)\",\s*\n/;
push @about_authors, $1;
}
}
close ABOUT;
}
my @uncredited;
foreach my $person (@changelog_people)
{
if (! (grep {$_ eq $person} @thanks_people) &&
! (grep {$_ eq $person} @authors))
{
push @uncredited, $person;
}
}
my @double_credited;
foreach my $person (@authors)
{
if (grep {$_ eq $person} @thanks_people)
{
push @double_credited, $person;
}
}
my @author_names;
foreach my $person (@authors)
{
$person =~ s/\s*<.*//;
push @author_names, $person;
}
my @not_in_about;
foreach my $person (@author_names)
{
push @not_in_about, $person unless grep {$_ eq $person} @about_authors;
}
my @only_in_about;
foreach my $person (@about_authors)
{
push @only_in_about, $person unless grep {$_ eq $person} @author_names;
}
my $printed = 0;
if (@uncredited)
{
print "\nThe following people are in the ChangeLog but not credited in THANKS or AUTHORS:\n\n";
foreach my $person (@uncredited)
{
print "${person}\n";
}
$printed = 1;
}
if (@double_credited)
{
print "\nThe following people are listed in both THANKS and AUTHORS:\n\n";
foreach my $person (@double_credited)
{
print "${person}\n";
}
$printed = 1;
} else {
if (!$found_about_authors)
{
print "\nDidn't find authors section in nautilus-window-menus.c\n";
$printed = 1;
}
if (@not_in_about)
{
print "\nThe following people are in AUTHORS but not the about screen:\n\n";
foreach my $person (@not_in_about)
{
print "${person}\n";
}
$printed = 1;
}
if (@only_in_about)
{
print "\nThe following people are in the about screen but not AUTHORS:\n\n";
foreach my $person (@only_in_about)
{
print "${person}\n";
}
$printed = 1;
}
}
print "\n" if $printed;