Skip to content

Instantly share code, notes, and snippets.

@rismoney
Created February 9, 2013 00:03
Show Gist options
  • Save rismoney/4743024 to your computer and use it in GitHub Desktop.
Save rismoney/4743024 to your computer and use it in GitHub Desktop.
$cwd='C:/Program Files (x86)/Puppet Labs/Puppet Enterprise/puppet/lib/puppet/type/file'
$patch='source.rb.patch'
$patchbin='C:\Tools\gnuwin32\bin\patch.exe'
exec {"apply patch for ${title}":
command => "${patchbin} -p0 < ${patch}",
cwd => $cwd,
onlyif => "${patchbin} -p0 -N --dry-run --silent < ${patch}",
}
# I get this
debug: Exec[apply patch for source.rb.patch](provider=windows): Executing check 'C:\Tools\gnuwin32\bin\patch.exe -p0 -N
--dry-run --silent < source.rb.patch'
debug: Executing 'C:\Tools\gnuwin32\bin\patch.exe -p0 -N --dry-run --silent < source.rb.patch'
debug: /Stage[main]/Puppet::Agent::Windows/Iselib::Patch[source.rb.patch]/Exec[apply patch for source.rb.patch]/onlyif:
C:\Tools\gnuwin32\bin\patch.exe: **** File < is not a regular file -- can't patch
@joshcooper
Copy link

may need to do something like:

cmd.exe /c "C:\Tools\gnuwin32\bin\patch.exe -p0 -N --dry-run --silent < source.rb.patch"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment