Bug#856532: Error: Can't locate object method "get_user"

Carnë Draug carandraug+dev at gmail.com
Thu Mar 16 19:16:41 UTC 2017


On 3 March 2017 at 18:09, gregor herrmann <gregoa at debian.org> wrote:
> On Thu, 02 Mar 2017 22:22:01 +0100, gregor herrmann wrote:
>
>> > == dh-make-perl 0.93 ==
>> > Trying /PATH/TO/MODULE/DISTRIBUTION/Dn-Role-v0.1/../Dn-Role-v0.1.tar .gz... found!
>> > Using META.json
>> > Found: Dn-Role 0.1 (libdn-role-perl arch=all)
>> > Can't locate object method "get_user" via package "DhMakePerl::Command::make" at /usr/share/perl5/DhMakePerl/Command/Packaging.pm line 130.
>
>> Carnë, this seems to be a side effect of
>> 23b15bd799ee7e7f9394119a98bdef510424be3d.
>> Could you take a look please? (I'm not sure what the best fix would
>> be that fits your refactoring.)
>
> How about this change?
>
> diff --git a/lib/DhMakePerl/Command/Packaging.pm b/lib/DhMakePerl/Command/Packaging.pm
> index 690740a..c54942b 100644
> --- a/lib/DhMakePerl/Command/Packaging.pm
> +++ b/lib/DhMakePerl/Command/Packaging.pm
> @@ -119,6 +119,12 @@ sub makefile_pl {
>      return $self->main_file('Makefile.PL');
>  }
>
> +sub get_user {
> +    my $self = shift;
> +    my $user = $ENV{LOGNAME} || $ENV{USER};
> +    return $user;
> +}
> +
>  sub get_email {
>      my $self = shift;
>      my $email = $self->cfg->email;
> @@ -138,7 +144,7 @@ sub get_name {
>      my $self = shift;
>
>      my $name;
> -    my $user = $ENV{LOGNAME} || $ENV{USER};
> +    my $user = $self->get_user;
>      my $pwnam = getpwuid($<);
>      die "Cannot determine current user\n" unless $pwnam;
>      if ( defined $ENV{DEBFULLNAME} ) {
>
>
> An alternative would be to drop the non-existing get_user() call from
> get_email() and use
>     my $user = $ENV{LOGNAME} || $ENV{USER};
>     $email = $user ...
> there; but this duplicates the user setting.

The new function get_user that you proposed sounds good to me.  I
pushed that change.  Sorry for causing this silly bug.

https://anonscm.debian.org/cgit/pkg-perl/packages/dh-make-perl.git/commit/?id=c8fb32794a028597cc15422223d84f5728f4c32f

Carnë



More information about the pkg-perl-maintainers mailing list