mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 17:28:01 +00:00
Fix unarchive for .deb which uses xz, and absolute paths
This commit is contained in:
parent
2ad1b2f5b1
commit
7227c4f0be
@ -8,6 +8,7 @@
|
|||||||
local remove_archive
|
local remove_archive
|
||||||
local success
|
local success
|
||||||
local file_name
|
local file_name
|
||||||
|
local file_path
|
||||||
local extract_dir
|
local extract_dir
|
||||||
|
|
||||||
if (( $# == 0 )); then
|
if (( $# == 0 )); then
|
||||||
@ -36,6 +37,7 @@ while (( $# > 0 )); do
|
|||||||
|
|
||||||
success=0
|
success=0
|
||||||
file_name="${1:t}"
|
file_name="${1:t}"
|
||||||
|
file_path="${1:A}"
|
||||||
extract_dir="${file_name:r}"
|
extract_dir="${file_name:r}"
|
||||||
case "$1:l" in
|
case "$1:l" in
|
||||||
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
|
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
|
||||||
@ -60,10 +62,10 @@ while (( $# > 0 )); do
|
|||||||
(*.deb)
|
(*.deb)
|
||||||
mkdir -p "$extract_dir/control"
|
mkdir -p "$extract_dir/control"
|
||||||
mkdir -p "$extract_dir/data"
|
mkdir -p "$extract_dir/data"
|
||||||
cd "$extract_dir"; ar vx "../${1}" > /dev/null
|
cd "$extract_dir"; ar vx "${file_path}" > /dev/null
|
||||||
cd control; tar xzvf ../control.tar.gz
|
cd control; tar xvf ../control.tar.*
|
||||||
cd ../data; tar xzvf ../data.tar.gz
|
cd ../data; tar xvf ../data.tar.*
|
||||||
cd ..; rm *.tar.gz debian-binary
|
cd ..; rm control.tar.* data.tar.* debian-binary
|
||||||
cd ..
|
cd ..
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
|
Loading…
Reference in New Issue
Block a user