Skip Menu |

This queue is for tickets about the Shell-EnvImporter CPAN distribution.

Report information
The Basics
Id: 124050
Status: new
Priority: 0/
Queue: Shell-EnvImporter

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Can't handle multi-line ENV values

Trying to debug this, I found that it reads the output of "env" linewise.

 

This however gets confused when there's an env-var called "TIMEFORMAT" with the value of

 

TIMEFORMAT=
real   %3lR
user   %3lU
sys    %3lS
cpu    %P%%

This is uh, a problem:

env -i /usr/bin/perl -E '$ENV{FOO}="foo\nBAZ=quux"; system(q[env])'
FOO=foo
BAZ=quux

env -i /usr/bin/perl -E '$ENV{FOO}="foo\nBAZ=quux"; system(qw(perl -MData::Dumper=Dumper -E), "say Dumper(\\%ENV)")'
$VAR1 = {
          'FOO' => 'foo
BAZ=quux'
        };
 

Which means "env" is not a reliable way to read the environment values.

 

So subsequently:

Parsed ENV: 'LC_CTYPE=en_NZ.UTF8' => 'LC_CTYPE' => 'en_NZ.UTF8'
Parsed ENV: 'QT_XCB_NO_XI2_MOUSE=1' => 'QT_XCB_NO_XI2_MOUSE' => '1'
Parsed ENV: '_system_name=Gentoo' => '_system_name' => 'Gentoo'
Parsed ENV: 'SSH_AGENT_PID=3230' => 'SSH_AGENT_PID' => '3230'
Parsed ENV: 'TIMEFORMAT=' => 'TIMEFORMAT' => ''
Parsed ENV: 'real   %3lR' => 'real   %3lR' => ''
Parsed ENV: 'user   %3lU' => 'user   %3lU' => ''
Parsed ENV: 'sys    %3lS' => 'sys    %3lS' => ''
Parsed ENV: 'cpu    %P%%' => 'cpu    %P%%' => ''
Parsed ENV: '' => '' => ''
Parsed ENV: 'GSETTINGS_BACKEND=dconf' => 'GSETTINGS_BACKEND' => 'dconf'

And this really confuses tests.

-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )