From 7f09562685969a936b91f246b125483b0569d4d6 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Wed, 18 Jan 2012 22:32:31 +0200 Subject: [PATCH] Ensure patch is installed in util::patch --- util/manifests/init.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util/manifests/init.pp b/util/manifests/init.pp index 544c55c..ebb74f8 100644 --- a/util/manifests/init.pp +++ b/util/manifests/init.pp @@ -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"], } }