Skip to content

add support for 7zip #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manifests/deploy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$password = undef, #: https or ftp user password or https certificate password
$environment = undef, #: environment variable for settings such as http_proxy
$strip = undef, #: extract file with the --strip=X option. Only works with GNU tar.
$use_7zip = false, #: alternative to unzip command on Windows
$unzip_opts = '', #: additional options to pass the unzip command.
$timeout = undef, #: the time to wait for the file transfer to complete
$user = undef, #: extract file as this user
Expand Down Expand Up @@ -35,6 +36,7 @@
group => $group,
environment => $environment,
strip => $strip,
use_7zip => $use_7zip,
unzip_opts => $unzip_opts,
subdir => $caller_module_name,
creates => $creates,
Expand Down
7 changes: 6 additions & 1 deletion manifests/extract.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
$group = undef, #: extract file as this group.
$environment = undef, #: environment variables.
$strip = undef, #: extract file with the --strip=X option. Only works with GNU tar.
$use_7zip = false, #: alternative to unzip command on Windows
$unzip_opts = '', #: additional options to pass the unzip command.
$subdir = $caller_module_name #: subdir per module in staging directory.
) {
Expand Down Expand Up @@ -92,7 +93,11 @@
}

/.zip$/: {
$command = "unzip ${unzip_opts} ${source_path}"
if $use_7zip {
$command = "7z x ${source_path} ${unzip_opts}"
} else {
$command = "unzip ${unzip_opts} ${source_path}"
}
}

/(.war|.jar)$/: {
Expand Down