Ensure patch is installed in util::patch

This commit is contained in:
Ossi Salmi 2012-01-18 22:32:31 +02:00
parent 1255a15d6c
commit 7f09562685

View file

@ -120,6 +120,18 @@ define util::extract::zip($source, $ensure=present) {
}
# Install patch.
#
class util::patch::package {
if $kernel == "Linux" {
package { "patch":
ensure => installed,
}
}
}
# Apply patch.
#
@ -142,11 +154,14 @@ define util::extract::zip($source, $ensure=present) {
#
define util::patch($source, $strip=0) {
include util::patch::package
exec { "patch-${name}-${source}":
path => "/bin:/usr/bin:/sbin:/usr/sbin",
cwd => "${name}",
command => "patch -N -b -t -p${strip} < ${source}",
onlyif => "patch --dry-run -N -b -t -p${strip} < ${source}",
require => Class["util::patch::package"],
}
}