From: Ian Kelling Date: Mon, 29 Jul 2019 00:08:17 +0000 (-0400) Subject: better deb extraction X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=f0fb727480e27b66697b300d4046e8148b5623aa;p=small-misc-bash better deb extraction --- diff --git a/ex b/ex index 0ef26c4..cf04ee6 100755 --- a/ex +++ b/ex @@ -38,10 +38,15 @@ Note: dtrx (package & command) extracts most of these plus some others." *.bz2 ) bunzip2 "$x" ;; *.deb ) ar x "$x" - tar Jxf data.tar.xz + tmp=(data.tar.*) + case $tmp in + *.xz) tar xJf data.tar.xz ;; + *.gz) tar xzf data.tar.gz ;; + *) echo "error: could not find data.tar.*" >&2; exit 1 ;; + esac tar xzf control.tar.gz rm -f control.tar.gz - rm -f data.tar.xz + rm -f data.tar.* ;; *.dsc) dpkg-source -x "$x" ;; *.gz ) gunzip "$x" ;;