Skip to content
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

[enh] add xz decompression for sources #1785

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
add xz decompression for sources
  • Loading branch information
emmanuel-averty committed Feb 28, 2024
commit 56c45133b6e1997dbb0e9e3019b8ca0da8b54808
10 changes: 10 additions & 0 deletions helpers/utils
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ ynh_setup_source() {
elif [[ "$src_url" =~ ^.*\.tar\.bz2$ ]]
then
src_format="tar.bz2"
elif [[ "$src_url" =~ ^.*\.xz$ ]]
then
src_format="xz"
elif [[ -z "$src_extract" ]]
then
src_extract="false"
Expand Down Expand Up @@ -329,6 +332,13 @@ ynh_setup_source() {
unzip -quo $src_filename -d "$dest_dir"
fi
ynh_secure_remove --file="$src_filename"
elif [[ "$src_format" == "xz" ]]; then
if [[ -z "$src_rename" ]]; then
xz -d --stdout $src_filename > "$dest_dir/$(basename $src_filename)"
else
xz -d --stdout $src_filename > "$dest_dir/$src_rename"
fi

else
local strip=""
if [ "$src_in_subdir" != "false" ]; then
Expand Down