Skip Menu |

This queue is for tickets about the Perl-Dist-Strawberry CPAN distribution.

Report information
The Basics
Id: 119064
Status: open
Priority: 0/
Queue: Perl-Dist-Strawberry

People
Owner: Nobody in particular
Requestors: thompsonl [...] logh.net
Cc:
AdminCc:

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



Subject: portableshell.bat Recommendation
Date: Tue, 29 Nov 2016 19:28:02 -0800
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: Lee Thompson <thompsonl [...] logh.net>
I would recommend adding the following to portableshell.bat Right after @echo off add the line "setlocal". This will ensure that any environment variables set by portableshell.bat go away as soon as the script has exited (which since there's a cmd /k will be after the exit command is done.) But should the script not get that far, the user's environment variables won't have a bunch of extra ones in it (until that command interpreter is terminated). so: @echo off set drive=%~dp0 ... would become: @echo off setlocal set drive=%~dp0 ... -- Lee Thompson thompsonl@logh.net
Subject: Re: [rt.cpan.org #119064] portableshell.bat Recommendation
Date: Thu, 1 Dec 2016 20:01:59 +0100
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Hi, I see your point but have a look at the latest version https://github.com/StrawberryPerl/Perl-Dist-Strawberry/blob/master/share/portable/portableshell.bat Another user proposed a patch that now allows you to call: portableshell.bat /SETENV Could you please modify your proposal so that it supports also "/SETENV" feature? -- kmx
Subject: Re: [rt.cpan.org #119064] portableshell.bat Recommendation
Date: Thu, 1 Dec 2016 11:15:50 -0800
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: Lee Thompson <thompsonl [...] logh.net>
Show quoted text
> Could you please modify your proposal so that it supports also "/SETENV" feature?
Sure: Add one line after setlocal: @echo off setlocal if "%1" == "/SETENV" endlocal set drive=%~dp0 set drivep=%drive% if #%drive:~-1%# == #\# set drivep=%drive:~0,-1% ... endlocal turns off setlocal so the variables will remain set until that command interpreter is terminated. Alternatively the setlocal line could change to: if not "%1" == "/SETENV" setlocal -- Lee Thompson thompsonl@logh.net
Subject: Re: [rt.cpan.org #119064] portableshell.bat Recommendation
Date: Thu, 1 Dec 2016 22:28:39 +0100
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Subject: Re: [rt.cpan.org #119064] portableshell.bat Recommendation
Date: Thu, 1 Dec 2016 14:16:57 -0800
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: Lee Thompson <thompsonl [...] logh.net>
Perfect! It's a minor thing but will ensure that variables don't get overwritten or stick around past use unless the user wants/needs it. On 12/1/2016 1:28 PM, kmx via RT wrote: Show quoted text