The following commit has been merged in the ubuntu-master branch:
commit aa31f643447b3533675e6c169784048834ff9088
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date: Mon Apr 21 19:31:08 2008 +0200
[UBUNTU] Improve handling of maintainer fields, support original-maintainer
Handle and display Original-Maintainer field contents. Also treat
Uploaders as being related to Original-Maintainer if that exists
since AFAICT Ubuntu doesn't use this field.
Don't show the email addresses for Original-Maintainer, since they are
usually not needed anyway.
Add some helpful suggestions below maintainer email addresses to file
bugs or questions in launchpad instead. Usually this should give a
better response.
With thanks to Colin Watson <cjwatson -at- ubuntu com> for nagging
and suggestions.
diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm
index 13afcbc..00bc8cd 100644
--- a/lib/Packages/DoShow.pm
+++ b/lib/Packages/DoShow.pm
@@ -386,12 +386,16 @@ sub moreinfo {
if ($info{maintainers}) {
my $uploaders = $page->get_src( 'uploaders' );
+ my $orig_uploaders = $page->get_src( 'orig_uploaders' );
if ($uploaders && @$uploaders) {
my @maintainers = map { { name => $_->[0], mail => $_->[1] } }
@$uploaders;
$contents->{maintainers} = [EMAIL PROTECTED];
}
+ if ($orig_uploaders && @$orig_uploaders) {
+ my @orig_maintainers = map { { name => $_->[0], mail => $_->[1] } }
@$orig_uploaders;
+ $contents->{original_maintainers} = [EMAIL PROTECTED];
+ }
}
-
}
sub providers {
diff --git a/lib/Packages/Page.pm b/lib/Packages/Page.pm
index b9c41ee..879e6a6 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 );
+our @EXPORT_OK = qw( split_name_mail parse_deps handle_maintainer_fields);
our %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
our $ARCHIVE_DEFAULT = '';
@@ -51,6 +51,40 @@ sub split_name_mail {
return ($name, $email);
}
+sub handle_maintainer_fields {
+ my ($data) = @_;
+ my (@uploaders, @orig_uploaders);
+
+ if ($data->{'original-maintainer'}) {
+ push @orig_uploaders, [ split_name_mail( $data->{'original-maintainer'}
) ];
+
+ $data->{uploaders} ||= '';
+ my @up_tmp = split( /\s*,\s*/,
+ $data->{uploaders} );
+ foreach my $up (@up_tmp) {
+ push @orig_uploaders, [ split_name_mail( $up ) ];
+ }
+ if ($data->{maintainer} ||= '') {
+ push @uploaders, [ split_name_mail( $data->{maintainer} ) ];
+ }
+ } else {
+ if ($data->{maintainer} ||= '') {
+ push @uploaders, [ split_name_mail( $data->{maintainer} ) ];
+ }
+ if ($data->{uploaders}) {
+ my @up_tmp = split( /\s*,\s*/,
+ $data->{uploaders} );
+ foreach my $up (@up_tmp) {
+ if ($up ne $data->{maintainer}) { # weed out duplicates
+ push @uploaders, [ split_name_mail( $up ) ];
+ }
+ }
+ }
+ }
+
+ return ([EMAIL PROTECTED], [EMAIL PROTECTED]);
+}
+
sub add_src_data {
my ($self, $src, $data) = @_;
@@ -63,20 +97,9 @@ sub add_src_data {
$self->{src}{files} = [EMAIL PROTECTED];
}
$self->{src}{directory} = $data{directory};
- my @uploaders;
- if ($data{maintainer} ||= '') {
- push @uploaders, [ split_name_mail( $data{maintainer} ) ];
- }
- if ($data{uploaders}) {
- my @up_tmp = split( /\s*,\s*/,
- $data{uploaders} );
- foreach my $up (@up_tmp) {
- if ($up ne $data{maintainer}) { # weed out duplicates
- push @uploaders, [ split_name_mail( $up ) ];
- }
- }
- }
- $self->{src}{uploaders} = [EMAIL PROTECTED];
+ my ($uploaders, $orig_uploaders) = handle_maintainer_fields(\%data);
+ $self->{src}{uploaders} = $uploaders;
+ $self->{src}{orig_uploaders} = $orig_uploaders if @$orig_uploaders;
return 1;
}
@@ -95,7 +118,7 @@ sub is_virtual {
}
our @TAKE_NEWEST = qw( description description-md5 essential priority section
subsection tag
- archive source source-version homepage );
+ archive source source-version homepage maintainer
original-maintainer uploaders);
our @STORE_ALL = qw( version source source-version installed-size size
filename md5sum sha1 sha256 task
origin bugs suite archive section );
@@ -133,7 +156,7 @@ sub merge_package {
# packages from the central archive are preferred over all
# others with the same version number but from other archives
if ($is_newest = ($cmp > 0)
- || (!$cmp && ($data->{archive} eq 'us') &&
($self->{data}{archive} ne 'us'))) {
+ || (!$cmp && ($data->{archive} eq 'us') && ($self->{data}{archive} ne
'us'))) {
$self->{newest} = $version;
foreach my $key (@TAKE_NEWEST) {
$self->{data}{$key} = $data->{$key};
diff --git a/lib/Packages/SrcPage.pm b/lib/Packages/SrcPage.pm
index 62d96d0..47735cf 100644
--- a/lib/Packages/SrcPage.pm
+++ b/lib/Packages/SrcPage.pm
@@ -38,20 +38,9 @@ sub merge_package {
$self->{data} = $data;
- my @uploaders;
- if ($data->{maintainer} ||= '') {
- push @uploaders, [ split_name_mail( $data->{maintainer} ) ];
- }
- if ($data->{uploaders}) {
- my @up_tmp = split( /\s*,\s*/,
- $data->{uploaders} );
- foreach my $up (@up_tmp) {
- if ($up ne $data->{maintainer}) { # weed out duplicates
- push @uploaders, [ split_name_mail( $up ) ];
- }
- }
- }
- $self->{uploaders} = [EMAIL PROTECTED];
+ my ($uploaders, $orig_uploaders) = handle_maintainer_fields($data);
+ $self->{uploaders} = $uploaders;
+ $self->{orig_uploaders} = $orig_uploaders if @$orig_uploaders;
if ($data->{files}) {
my @files = split /\01/so, $data->{files};
diff --git a/templates/html/show.tmpl b/templates/html/show.tmpl
index 8f76bb2..19c0f08 100644
--- a/templates/html/show.tmpl
+++ b/templates/html/show.tmpl
@@ -98,12 +98,7 @@
[% END %]
[% END %]
-[% IF maintainers.size == 1 -%]
- <h3>[% g('Maintainer:') %]</h3>
-[%- ELSE -%]
- <h3>[% g('Maintainers:') %]</h3>
-[%- END %]
-[%- FOREACH maintainers;
+[%- BLOCK handle_maintainer;
mailarchiveurl = '';
IF (matches = mail.match('^(.*)@lists\.debian\.org$'));
mailarchiveurl = 'http://lists.debian.org/' _ uri_escape(matches.0) _
'/';
@@ -112,11 +107,43 @@
ELSIF (matches = mail.match('^(.*)@lists\.ubuntu\.com$'));
mailarchiveurl = 'http://lists.ubuntu.com/archives/' _
uri_escape(matches.0) _ '/';
END -%]
- [%- '<ul>' IF loop.first -%]
+ [% IF hide_mail %]
+ <li>[% name | html %]
+ [% ELSE %]
<li><a href="mailto:[% mail | html %]">[% name | html %]</a>
- [%- IF mailarchiveurl %](<a href="[% mailarchiveurl %]" title="[%
g('Archive of the Maintainer Mailinglist') %]">[% g('Mail Archive') %]</a>)[%
END %]
+ [% END %]
+ [%- IF mailarchiveurl %] (<a href="[% mailarchiveurl %]" title="[%
g('Archive of the Maintainer Mailinglist') %]">[% g('Mail Archive')
%]</a>)[% END %]
</li>
- [%- '</ul>' IF loop.last -%]
+[% END -%]
+
+[%- IF maintainers.size -%]
+[% IF maintainers.size == 1 -%]
+ <h3>[% g('Maintainer:') %]</h3>
+[%- ELSE -%]
+ <h3>[% g('Maintainers:') %]</h3>
+[%- END %]
+[%- FOREACH m IN maintainers;
+ '<ul>' IF loop.first;
+ PROCESS handle_maintainer name=m.name mail=m.mail;
+ '</ul>' IF loop.last;
+ END -%]
+<p>[% g('Please consider <a href="%s">filing a bug</a> or <a href="%s">asking
a question</a> via Launchpad before contacting the maintainer directly.',
+ "https://bugs.launchpad.net/ubuntu/+source/$src.pkg/+filebug",
+ "https://answers.launchpad.net/ubuntu/+source/$src.pkg/+addquestion")
%]</p>
+[%- END -%]
+
+[%- IF original_maintainers.size -%]
+[% IF original_maintainers.size == 1 -%]
+ <h3>[% g('Original Maintainer (usually from Debian):') %]</h3>
+[%- ELSE -%]
+ <h3>[% g('Original Maintainers (usually from Debian):') %]</h3>
+[%- END %]
+[%- FOREACH m IN original_maintainers;
+ '<ul>' IF loop.first;
+ PROCESS handle_maintainer name=m.name mail=m.mail hide_mail=1;
+ '</ul>' IF loop.last;
+ END -%]
+<p>[% g('It should generally not be necessary for users to contact the
original maintainer.') %]</p>
[%- END -%]
[% url = page.get_newest('url');
--
APT Archive Web-Frontend (Alioth repository)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]