HomePhorge

(#9461) Resolve executables using PATHEXT on Windows
0258096c474dUnpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(#9461) Resolve executables using PATHEXT on Windows

Previously, 'puppet resource package' fails on Windows when attempting
to invoke the 'gem' executable, because on Windows, 'gem' is a ruby
script which must be executed by calling the batch wrapper, 'gem.bat'.

This commit modifies Puppet::Util.which such that if a non-absolute
path is given, then for each directory in PATH, and each extension in
PATHEXT, it returns the first file that exists and is executable. If
the PATHEXT environment variable is not defined, then it defaults to
the same values that cmd.exe uses and are known to work across all
Windows versions.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU48c6077682be: Merge remote-tracking branch 'josh/maint/2.7.x/reenable-fails-on-windows'…
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU0258096c474d: (#9461) Resolve executables using PATHEXT on Windows (authored by Josh Cooper <josh@puppetlabs.com>).Oct 7 2011, 1:43 AM