HomePhorge

(#10799) Regexp escaping too much
220f2bad2692Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(#10799) Regexp escaping too much

Previously, we were substituting occurrences of <ruby> and <command>
in the Windows batch wrapper scripts with the corresponding
paths. However, the call to Regexp.gsub was escaping potential
backreferences in the replacement string, e.g. foo\1bar, but in doing
so, was also escaping valid path characters that don't need to be
escaped, e.g. ruby-1.8.7, causing the batch file to refer to
non-existent paths, e.g. ruby\-1\.8\.7.

This commit eliminates the need for gsub and regexp escaping.

It also writes the bat file in 'text' mode so that the resulting file
has '\r\n' line endings.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU5bb0fb7b484e: Merge remote-tracking branch 'josh/ticket/2.7.x/10727-undefined-method…
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU220f2bad2692: (#10799) Regexp escaping too much (authored by Josh Cooper <josh@puppetlabs.com>).Nov 15 2011, 10:16 PM