[pkg-perl-tools] 01/03: Search for distribution name in debian/upstream/metadata

Alex Muntada alexm-guest at moszumanska.debian.org
Sun May 22 10:48:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

alexm-guest pushed a commit to branch master
in repository pkg-perl-tools.

commit 0ea6a61bfba5c06f6c69d5f8285e395d2f028235
Author: Alex Muntada <alexm at alexm.org>
Date:   Sat May 21 20:03:12 2016 +0200

    Search for distribution name in debian/upstream/metadata
---
 scripts/forward | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/forward b/scripts/forward
index 1bb3a77..b49f7f7 100755
--- a/scripts/forward
+++ b/scripts/forward
@@ -15,6 +15,7 @@ use Time::Piece qw(localtime);
 use Text::Wrap qw(wrap);
 use Proc::InvokeEditor;
 use MIME::Lite;
+use YAML::XS;
 
 use warnings;
 use strict;
@@ -36,7 +37,8 @@ dpt-forward - Forward a bug or a patch upstream
 
 =item B<-d> I<name>
 
-Distribution name. Determined from F<META>, the C<Homepage> field in
+Distribution name. Determined from F<META>, the C<Name> field in
+F<debian/upstream/metadata>, the C<Homepage> field in
 F<debian/control> file or the C<Source> field in F<debian/copyright>, in that
 order.
 
@@ -146,6 +148,9 @@ $opt_meta_file //= 'META.yml' if -e 'META.yml';
 my $meta;
 $meta = CPAN::Meta->load_file($opt_meta_file) if $opt_meta_file;
 
+my $upstream_metadata = YAML::XS->LoadFile('debian/upstream/metadata')
+    if -e 'debian/upstream/metadata';
+
 $opt_dist ||= $meta->name if $meta;
 $opt_dist ||= detect_dist();
 
@@ -302,6 +307,10 @@ sub get_subject {
 }
 
 sub detect_dist {
+    return $upstream_metadata->{Name}
+        if $upstream_metadata
+        and exists $upstream_metadata->{Name};
+
     open my $dctrl, '<', 'debian/control';
 
     while ( my $line = <$dctrl> ) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git



More information about the Pkg-perl-cvs-commits mailing list