Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Fixup, for Solaris
Browse files Browse the repository at this point in the history
  • Loading branch information
buzzdeee committed Aug 30, 2016
1 parent d75c797 commit 4231b94
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
17 changes: 10 additions & 7 deletions manifests/extract.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@
$strip_components=0,
$purge=false,
$user=undef,
$tar_command=$::osfamily ? {
'Solaris' => 'gtar',
default => 'tar',
},
$tar_command,
) {

require ::archive::params
Expand All @@ -55,13 +52,19 @@
$extract_dir = "${target}/${name}"
}

if $tar_command {
$real_tar_command = $tar_command
} else {
$real_tar_command = $::archive::params::tarcmd
}

case $ensure {
'present': {

$extract_zip = "unzip -o ${src_target}/${name}.${extension} -d ${target}"
$extract_targz = "${::archive::params::tarcmd} --no-same-owner --no-same-permissions --strip-components=${strip_components} -xzf ${src_target}/${name}.${extension} -C ${target}"
$extract_tarbz2 = "${::archive::params::tarcmd} --no-same-owner --no-same-permissions --strip-components=${strip_components} -xjf ${src_target}/${name}.${extension} -C ${target}"
$extract_tarxz = "${::archive::params::tarcmd} --no-same-owner --no-same-permissions --strip-components=${strip_components} -xpf ${src_target}/${name}.${extension} -C ${target}"
$extract_targz = "${real_tar_command} --no-same-owner --no-same-permissions --strip-components=${strip_components} -xzf ${src_target}/${name}.${extension} -C ${target}"
$extract_tarbz2 = "${real_tar_command} --no-same-owner --no-same-permissions --strip-components=${strip_components} -xjf ${src_target}/${name}.${extension} -C ${target}"
$extract_tarxz = "${real_tar_command} --no-same-owner --no-same-permissions --strip-components=${strip_components} -xpf ${src_target}/${name}.${extension} -C ${target}"

$purge_command = $purge ? {
true => "rm -rf ${target} && ",
Expand Down
12 changes: 12 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
}
$binary_indicator = undef
}
'Solaris': {
$tarcmd = 'gtar'
$digest_types = {
'md5' => 'md5sum',
'sha1' => 'sha1sum',
'sha224' => 'sha224sum',
'sha256' => 'sha256sum',
'sha384' => 'sha384sum',
'sha512' => 'sha512sum',
}
$binary_indicator = '*'
}
default: {
$tarcmd = 'tar'
$digest_types = {
Expand Down

0 comments on commit 4231b94

Please sign in to comment.