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 = '';
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 (\@uploaders, \@orig_uploaders);
+}
+
sub add_src_data {
my ($self, $src, $data) = @_;
$self->{src}{files} = \@files;
}
$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} = \@uploaders;
+ my ($uploaders, $orig_uploaders) = handle_maintainer_fields(\%data);
+ $self->{src}{uploaders} = $uploaders;
+ $self->{src}{orig_uploaders} = $orig_uploaders if @$orig_uploaders;
return 1;
}
}
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 );
# 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};
$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} = \@uploaders;
+ 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};
[% 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) _ '/';
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');