Unverified Commit 59a9b453 authored by Alexander Kapshuna's avatar Alexander Kapshuna Committed by Marc Cornellà
Browse files

fix(extract): support unpacking deb file from different directory

parent 6dc937ff
...@@ -60,13 +60,13 @@ extract() { ...@@ -60,13 +60,13 @@ extract() {
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;; (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;; (*.7z) 7za x "$1" ;;
(*.deb) (*.deb)
mkdir -p "$extract_dir/control" local pwd="$PWD" file="${1:A}"
mkdir -p "$extract_dir/data" mkdir -p "$extract_dir/control" "$extract_dir/data"
cd "$extract_dir"; ar vx "../${1}" > /dev/null builtin cd -q "$extract_dir"; ar vx "$file" > /dev/null
cd control; tar xzvf ../control.tar.gz builtin cd -q control; extract ../control.tar.*
cd ../data; extract ../data.tar.* builtin cd -q ../data; extract ../data.tar.*
cd ..; rm *.tar.* debian-binary builtin cd -q ..; command rm *.tar.* debian-binary
cd .. builtin cd -q "$pwd"
;; ;;
(*.zst) unzstd "$1" ;; (*.zst) unzstd "$1" ;;
(*.cab) cabextract -d "$extract_dir" "$1" ;; (*.cab) cabextract -d "$extract_dir" "$1" ;;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment