From: Frank Lichtenheld Date: Mon, 21 Apr 2008 18:02:04 +0000 (+0200) Subject: [UBUNTU] Implement on-the-fly rewriting of maintainer fields X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=974926bc9499febca5504f5e4da8e4733ddd960e;p=deb%2Fpackages.git [UBUNTU] Implement on-the-fly rewriting of maintainer fields Implement the same rules as pkgbinarymangler for rewriting maintainer fields. This will fix the maintainer field of source packages that were taken without changes from Debian and contain therefor still the original maintainer information. This should significantly reduce the number of Debian maintainers that are listed on packages.ubuntu.com as Maintainers. Thanks again to Colin Watson for the suggestion. --- diff --git a/lib/Packages/Page.pm b/lib/Packages/Page.pm index 879e6a6..4772f83 100644 --- a/lib/Packages/Page.pm +++ b/lib/Packages/Page.pm @@ -10,7 +10,7 @@ use Packages::CGI; use Packages::I18N::Locale; our @ISA = qw( Exporter ); -our @EXPORT_OK = qw( split_name_mail parse_deps handle_maintainer_fields); +our @EXPORT_OK = qw( split_name_mail parse_deps ); our %EXPORT_TAGS = ( all => [ @EXPORT_OK ] ); our $ARCHIVE_DEFAULT = ''; @@ -51,8 +51,46 @@ sub split_name_mail { return ($name, $email); } +sub override_maint { + my ($self, $data) = @_; + + return if $data->{'original-maintainer'}; + return unless $data->{maintainer}; + + my ($name, $mail) = split_name_mail( $data->{maintainer} ); + + # taken from etc/pkgbinarymangler/maintainermangler.overrides + return if $mail =~ /\@(ubuntu\.com|canonical\.com|lists\.ubuntu\.com|lists\.canonical\.com|ubuntu\.com\.au|kubuntu\.org)^/o; + return if $mail =~ /^(lamont\@debian\.org|q-funk\@iki\.fi|cjwatson\@debian\.org|patrick\.matthaei\@web\.de)^/o; + + if ($mail eq 'adconrad@0c3.net') { + $data->{maintainer} = 'Adam Conrad '; + return 1; + } + if ($mail eq 'mpitt@debian.org') { + $data->{maintainer} = 'Martin Pitt '; + return 1; + } + + $data->{'original-maintainer'} = $data->{maintainer}; + foreach ($data->{section}) { + /^(main|restricted)$/ && do { + $data->{maintainer} = 'Ubuntu Core Developers '; + last; + }; + /^(uni|multi)verse$/ && do { + $data->{maintainer} = 'Ubuntu MOTU Developers '; + last; + }; + + die 'Huh?'; + } + + return 1; +} + sub handle_maintainer_fields { - my ($data) = @_; + my ($self, $data) = @_; my (@uploaders, @orig_uploaders); if ($data->{'original-maintainer'}) { @@ -69,6 +107,10 @@ sub handle_maintainer_fields { } } else { if ($data->{maintainer} ||= '') { + if ($self->override_maint($data)) { + return $self->handle_maintainer_fields($data); + } + push @uploaders, [ split_name_mail( $data->{maintainer} ) ]; } if ($data->{uploaders}) { @@ -97,7 +139,7 @@ sub add_src_data { $self->{src}{files} = \@files; } $self->{src}{directory} = $data{directory}; - my ($uploaders, $orig_uploaders) = handle_maintainer_fields(\%data); + my ($uploaders, $orig_uploaders) = $self->handle_maintainer_fields(\%data); $self->{src}{uploaders} = $uploaders; $self->{src}{orig_uploaders} = $orig_uploaders if @$orig_uploaders; diff --git a/lib/Packages/SrcPage.pm b/lib/Packages/SrcPage.pm index 47735cf..433bb9d 100644 --- a/lib/Packages/SrcPage.pm +++ b/lib/Packages/SrcPage.pm @@ -38,7 +38,7 @@ sub merge_package { $self->{data} = $data; - my ($uploaders, $orig_uploaders) = handle_maintainer_fields($data); + my ($uploaders, $orig_uploaders) = $self->handle_maintainer_fields($data); $self->{uploaders} = $uploaders; $self->{orig_uploaders} = $orig_uploaders if @$orig_uploaders;