[libconfig-model-dpkg-perl] 01/11: compute Maintainer default from DEBNAME and DEBEMAIL

dod at debian.org dod at debian.org
Mon Jul 11 18:23:20 UTC 2016


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

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit 061dce9e68a13e410a082b97e009464683266161
Author: Dominique Dumont <dod at debian.org>
Date:   Fri Jul 8 18:50:05 2016 +0200

    compute Maintainer default from  DEBNAME and DEBEMAIL
    
    The test is modified otherwise the test fails when DEBNAME
    or DEBEMAIL is not set
---
 lib/Config/Model/models/Dpkg/Control/Source.pl | 9 +++++++++
 t/dpkg.t                                       | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/lib/Config/Model/models/Dpkg/Control/Source.pl b/lib/Config/Model/models/Dpkg/Control/Source.pl
index 7006e53..7834d7d 100644
--- a/lib/Config/Model/models/Dpkg/Control/Source.pl
+++ b/lib/Config/Model/models/Dpkg/Control/Source.pl
@@ -30,6 +30,15 @@ For details, see L<section 5.7 of Debian policy|https://www.debian.org/doc/debia
       },
       'Maintainer',
       {
+        'compute' => {
+          'allow_override' => '1',
+          'formula' => 'my $name = $ENV{DEBFULLNAME};
+my $email = $ENV{DEBEMAIL} ;
+my $ret;
+$ret = "$name <$email>" if defined $name and defined $email;
+$ret;',
+          'use_eval' => '1'
+        },
         'description' => 'The package maintainer\'s name and email address. The name must come first, then the email address inside angle brackets <> (in RFC822 format).
 
 If the maintainer\'s name contains a full stop then the whole field will not work directly as an email address due to a misfeature in the syntax specified in RFC822; a program using this field as an address must check for this and correct the problem if necessary (for example by putting the name in round brackets and moving it to the end, and bringing the email address forward). ',
diff --git a/t/dpkg.t b/t/dpkg.t
index c61ab05..97cbbde 100644
--- a/t/dpkg.t
+++ b/t/dpkg.t
@@ -69,6 +69,9 @@ my $root = $dpkg->config_root ;
 
 my $opt = 'config\..*|configure|.*Makefile.in|aclocal.m4|\.pc' ;
 
+# load mandatory values otherwise the exits on error during next test
+$root->load("control source Maintainer=foo\@bar.com");
+
 my @test = (
     [ "clean=foo,bar,baz",           'clean',         "foo\nbar\nbaz\n" ],
     [ 'source format="3.0 (quilt)"', 'source/format', "3.0 (quilt)\n" ],

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



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