From 1761685d3e8d0594ff580c968874665e64a9a9cb Mon Sep 17 00:00:00 2001 From: Filipe Nascimento Date: Tue, 17 Dec 2019 13:35:40 -0300 Subject: extract: add zstd support (#8469) --- plugins/extract/README.md | 3 +++ plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/extract') diff --git a/plugins/extract/README.md b/plugins/extract/README.md index 41b6a61f1..aca300097 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -34,15 +34,18 @@ plugins=(... extract) | `tar.gz` | Tarball with gzip compression | | `tar.xz` | Tarball with lzma2 compression | | `tar.zma` | Tarball with lzma compression | +| `tar.zst` | Tarball with zstd compression | | `tbz` | Tarball with bzip compression | | `tbz2` | Tarball with bzip2 compression | | `tgz` | Tarball with gzip compression | | `tlz` | Tarball with lzma compression | | `txz` | Tarball with lzma2 compression | +| `tzst` | Tarball with zstd compression | | `war` | Web Application archive (Java-based) | | `xpi` | Mozilla XPI module file | | `xz` | LZMA2 archive | | `zip` | Zip archive | +| `zst` | Zstandard file (zstd) | See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information regarding archive formats. diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 0257ce231..47b918b29 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 27b9e50f1..b7d4e3ba7 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -40,6 +40,10 @@ extract() { tar --lzma --help &> /dev/null \ && tar --lzma -xvf "$1" \ || lzcat "$1" | tar xvf - ;; + (*.tar.zst|*.tzst) + tar --zstd --help &> /dev/null \ + && tar --zstd -xvf "$1" \ + || zstdcat "$1" | tar xvf - ;; (*.tar) tar xvf "$1" ;; (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.bz2) bunzip2 "$1" ;; @@ -59,6 +63,7 @@ extract() { cd ..; rm *.tar.* debian-binary cd .. ;; + (*.zst) unzstd "$1" ;; (*) echo "extract: '$1' cannot be extracted" >&2 success=1 -- cgit v1.2.3-70-g09d2 From ad1169bf39d8cab3e0139299d8200dd18bdc2038 Mon Sep 17 00:00:00 2001 From: Mustaqim Malim Date: Wed, 18 Dec 2019 09:53:54 +0000 Subject: extract: add tar.lz support (#8479) --- plugins/extract/README.md | 1 + plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/extract') diff --git a/plugins/extract/README.md b/plugins/extract/README.md index aca300097..d6e4fa116 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -32,6 +32,7 @@ plugins=(... extract) | `tar` | Tarball | | `tar.bz2` | Tarball with bzip2 compression | | `tar.gz` | Tarball with gzip compression | +| `tar.lz` | Tarball with lzip compression | | `tar.xz` | Tarball with lzma2 compression | | `tar.zma` | Tarball with lzma compression | | `tar.zst` | Tarball with zstd compression | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 47b918b29..e9d12d4d3 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index b7d4e3ba7..5cc30d1ce 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -45,6 +45,7 @@ extract() { && tar --zstd -xvf "$1" \ || zstdcat "$1" | tar xvf - ;; (*.tar) tar xvf "$1" ;; + (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;; (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; -- cgit v1.2.3-70-g09d2 From 6bac9eb103fe6c777182746e3a6e84dfc882338b Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 29 Dec 2019 05:36:29 +0100 Subject: extract: add lrz support (#8500) --- plugins/extract/README.md | 2 ++ plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/extract') diff --git a/plugins/extract/README.md b/plugins/extract/README.md index d6e4fa116..a6630de3f 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -25,6 +25,7 @@ plugins=(... extract) | `gz` | Gzip file | | `ipsw` | iOS firmware file | | `jar` | Java Archive | +| `lrz` | LRZ archive | | `lzma` | LZMA archive | | `rar` | WinRAR archive | | `rpm` | RPM package | @@ -32,6 +33,7 @@ plugins=(... extract) | `tar` | Tarball | | `tar.bz2` | Tarball with bzip2 compression | | `tar.gz` | Tarball with gzip compression | +| `tar.lrz` | Tarball with lrzip compression | | `tar.lz` | Tarball with lzip compression | | `tar.xz` | Tarball with lzma2 compression | | `tar.zma` | Tarball with lzma compression | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index e9d12d4d3..034fe6df0 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 5cc30d1ce..349c9a776 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -46,9 +46,11 @@ extract() { || zstdcat "$1" | tar xvf - ;; (*.tar) tar xvf "$1" ;; (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;; + (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;; (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; + (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;; (*.lzma) unlzma "$1" ;; (*.z) uncompress "$1" ;; (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; -- cgit v1.2.3-70-g09d2