Use gtar on OpenBSD in util::extract::tar
This commit is contained in:
parent
4bc3dcedf6
commit
f774635313
1 changed files with 13 additions and 5 deletions
|
@ -38,8 +38,11 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) {
|
|||
file { "${name}":
|
||||
ensure => directory,
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
owner => "root",
|
||||
group => $operatingsystem ? {
|
||||
"openbsd" => "wheel",
|
||||
default => "root",
|
||||
},
|
||||
}
|
||||
|
||||
case regsubst($source, '.*\.([^.]+)$', '\1') {
|
||||
|
@ -48,14 +51,19 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) {
|
|||
bz2, tbz: { $cat = "bzcat" }
|
||||
}
|
||||
|
||||
$tar = $operatingsystem ? {
|
||||
"openbsd" => "gtar",
|
||||
default => "tar",
|
||||
}
|
||||
|
||||
if $preserve {
|
||||
$command = "${cat} ${source} | tar xf - --strip-components=${strip} -C ${name}"
|
||||
$command = "${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name}"
|
||||
} else {
|
||||
$command = "${cat} ${source} | tar xf - --strip-components=${strip} -C ${name} --no-same-owner --no-same-permissions"
|
||||
$command = "${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name} --no-same-owner --no-same-permissions"
|
||||
}
|
||||
|
||||
exec { "tar-extract-${name}":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
|
||||
command => $command,
|
||||
require => File["${name}"],
|
||||
unless => "test -n \"$(ls -A ${name})\"",
|
||||
|
|
Loading…
Add table
Reference in a new issue