Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

Item10209: rewriteshebang Failure with unexpected perl path input

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine FoswikiTools  
The tools script rewriteshebang does not work with my path to the perl executable to be used.

My perl path is /depot/perl-5.8.3/bin/perl and the script fails on line 96 of tools/rewriteshebang.pl in release 1.1.2.

if ( $new_path =~ /(^(\.)?(\/{1}\w+)+(\.exe)?$|^:alpha:{1}:(\\{1}\w+)+(\.exe)?$|^perl$)/i )

It reports the following error

ERROR: Regex verfication of given path failed. Going to exit.

In release 1.1.0 and all previous versions, I only had to fix a simple file test to get it to work. The fix is more difficult now and is not easily scriptable so my upgrade script becomes more difficult.

My workaround is to rewrite this line as:

if ( $new_path =~ /^(\S+)$/)

There is another line in the script with the same problem that is not executed in my situation.

-- PhilipSchmidt - 30 Dec 2010

There is a fix already committed for 1.1.3 for other issues that addresses this regex a bit.

Please see if the updated regex in http://trac.foswiki.org/changeset/10023 works for your situation. If not, we'll work on this further for 1.1.3. Thanks

-- GeorgeClark - 30 Dec 2010

The version for release 1.1.3 seems to work.

-- PhilipSchmidt - 30 Dec 2010

Thanks for testing. Setting this to Waiting for Release so the resolution shows up in the 1.1.3 release notes.

-- GeorgeClark - 31 Dec 2010

One thing I noticed when running this is that it reports 0 files changed but it actually did change the perl version used in the first line of all the scripts.

Enter path to interpreter [hit enter to choose '/linux/depot/perl-5.8.3/bin/perl']: /depot/perl-5.8.3/bin/perl
Enter path to interpreter [hit enter to choose '/depot/perl-5.8.3/bin/perl']: 

The new Perl interpreter uses version "5.008003". If your path was just
"perl" this number might be wrong as in web server context you may use a
different environment. The verified version is not recommended for a current
Foswiki installation.
Are you still sure you want to use this path (y/n): y

New Perl interpreter uses version 5.008003

"No" will only change "shebang" lines of scripts found in the directory
where the script is run from. Are you sure you want to change scripts
in the 2 directories:
../tools
../bin
(y/n)?: no

Modified files:
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/edit.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/search.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/compare.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/login.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/register.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/rest.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/statistics.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/rename.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/view.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/resetpasswd.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/changes.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/logon.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/rdiffauth.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/viewfile.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/save.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/upload.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/rdiff.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/configure.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/preview.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/oops.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/manage.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/viewauth.cgi - 1 
/remote/dept5428a/customer_cases/philip/public_html/Foswiki-1.1.0/bin/attach.cgi - 1 
0 of 23 files changed

-- PhilipSchmidt - 31 Dec 2010
 

ItemTemplate edit

Summary rewriteshebang Failure with unexpected perl path input
ReportedBy PhilipSchmidt
Codebase 1.1.2
SVN Range
AppliesTo Engine
Component FoswikiTools
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease patch
ReleasedIn 1.1.3
Topic revision: r7 - 16 Apr 2011, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License