You are here: Foswiki>Tasks Web>Item13913 (08 Feb 2016, GeorgeClark)Edit Attach

Item13913: CLI scripts broken on windows. setlib.cfg issues "require CGI" which sets binmode on STDIN and breaks prompts.

pencil
Priority: Urgent
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Engine
Component: FoswikiTools, Configure
Branches: master Release02x00 Item13897
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Commit distro:3b31eb52e2bc added a "require CGI" to be able to "fail early" for critical missing dependencies.

Unfortunately on Windows, this breaks the CLI scripts - tools/configure. CGI appears to force binmode on STDIN and STDOUT. This causes chomp to fail to remove line endings.

-- GeorgeClark - 05 Jan 2016

A simple fix appears to be to set binmode(STDIN ':crlf'); in the tools scripts that do prompting, mostly reverting the impact of binmode in CGI. One subtle difference is that Ctrl-Z EOF is not handled by :crlf layer, but is honored if binmode was not called.

Either that or remove the require CGI from setlib.cfg.

-- GeorgeClark - 05 Jan 2016
 

ItemTemplate edit

Summary CLI scripts broken on windows. setlib.cfg issues "require CGI" which sets binmode on STDIN and breaks prompts.
ReportedBy GeorgeClark
Codebase 2.0.3
SVN Range
AppliesTo Engine
Component FoswikiTools, Configure
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:89cb46c0fb4e distro:ed9fb9d47f4a
TargetRelease minor
ReleasedIn 2.1.0
CheckinsOnBranches master Release02x00 Item13897
trunkCheckins
masterCheckins distro:89cb46c0fb4e
ItemBranchCheckins distro:89cb46c0fb4e
Release02x00Checkins distro:ed9fb9d47f4a
Release01x01Checkins
Topic revision: r4 - 08 Feb 2016, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy