Ensure patch is installed in util::patch
This commit is contained in:
parent
1255a15d6c
commit
7f09562685
1 changed files with 15 additions and 0 deletions
|
@ -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.
|
# Apply patch.
|
||||||
#
|
#
|
||||||
|
@ -142,11 +154,14 @@ define util::extract::zip($source, $ensure=present) {
|
||||||
#
|
#
|
||||||
define util::patch($source, $strip=0) {
|
define util::patch($source, $strip=0) {
|
||||||
|
|
||||||
|
include util::patch::package
|
||||||
|
|
||||||
exec { "patch-${name}-${source}":
|
exec { "patch-${name}-${source}":
|
||||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
cwd => "${name}",
|
cwd => "${name}",
|
||||||
command => "patch -N -b -t -p${strip} < ${source}",
|
command => "patch -N -b -t -p${strip} < ${source}",
|
||||||
onlyif => "patch --dry-run -N -b -t -p${strip} < ${source}",
|
onlyif => "patch --dry-run -N -b -t -p${strip} < ${source}",
|
||||||
|
require => Class["util::patch::package"],
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue