From 6d8b5e7dc1c6035e02215cbb06e7e34243aa95d9 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Fri, 31 Jul 2015 16:00:17 -0400 Subject: [PATCH] Fix unarchive for .deb which uses xz, and absolute paths --- modules/archive/functions/unarchive | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/archive/functions/unarchive b/modules/archive/functions/unarchive index f1b4224a..72dfbd1f 100644 --- a/modules/archive/functions/unarchive +++ b/modules/archive/functions/unarchive @@ -8,6 +8,7 @@ local remove_archive local success local file_name +local file_path local extract_dir if (( $# == 0 )); then @@ -36,6 +37,7 @@ while (( $# > 0 )); do success=0 file_name="${1:t}" + file_path="${1:A}" extract_dir="${file_name:r}" case "$1:l" in (*.tar.gz|*.tgz) tar xvzf "$1" ;; @@ -60,10 +62,10 @@ while (( $# > 0 )); do (*.deb) mkdir -p "$extract_dir/control" mkdir -p "$extract_dir/data" - cd "$extract_dir"; ar vx "../${1}" > /dev/null - cd control; tar xzvf ../control.tar.gz - cd ../data; tar xzvf ../data.tar.gz - cd ..; rm *.tar.gz debian-binary + cd "$extract_dir"; ar vx "${file_path}" > /dev/null + cd control; tar xvf ../control.tar.* + cd ../data; tar xvf ../data.tar.* + cd ..; rm control.tar.* data.tar.* debian-binary cd .. ;; (*)