Summary: | dev-perl/Shell-EnvImporter-1.70.0-r1 on dev-lang/perl-5.20.1-r1 reports warnings in app-portage/g-cpan-0.16.5 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Martin von Gagern <Martin.vGagern> |
Component: | [OLD] Development | Assignee: | Robin Johnson <robbat2> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | Sergiy.Borodych |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo-perl/g-cpan/issues/6 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | Fix warnings |
Description
Martin von Gagern
2014-10-21 08:03:14 UTC
Created attachment 387114 [details, diff]
Fix warnings
I'm quoting the header of that patch file.
Avoid warnings on perl 5.20.
"Possible precedence issue with control flow operator
at Shell/EnvImporter/Result.pm line 88"
This one is due to the fact that "return ..." binds more strongly than
"and", so the function would simply "return $self->shell_status == 0",
disregarding $self->command_status and $self->env_status.
Changing "and" to "&&" solves this issue.
"Use of uninitialized value $_[1] in read at IO/Handle.pm"
This is because we don't initialize the hash "%buf" into which we read.
Initializing the relevant keys with the empty string solves this issue.
As a drive-by fix, we change the pipe handling so that the "last"
command breaks the "while" loop, not the inner "foreach" loop.
Good work! But seems like the patch should be passed to upstream. Can you please make a PR at https://github.com/gentoo-perl/g-cpan ? (In reply to Sergiy Borodych from comment #2) > But seems like the patch should be passed to upstream. I agree, and just posted https://rt.cpan.org/Public/Bug/Display.html?id=86171#txn-1422747 notifying devs of this issue. (In reply to Vladimir Smirnov from comment #3) > Can you please make a PR at https://github.com/gentoo-perl/g-cpan ? The patch is against EnvImporter, not g-cpan. But I did comment on the existing https://github.com/gentoo-perl/g-cpan/issues/6 so g-cpan devs should become aware of this as well. Since there is absolutely no motion upstream, I've added the first two chunks of the patch to dev-perl/Shell-EnvImporter-1.70.0-r2 (Sorry I dont do drive-by fixes. :) |