Message ID | 1471354514-12323-2-git-send-email-dmonakhov@openvz.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Aug 16, 2016 at 6:35 AM, Dmitry Monakhov <dmonakhov@openvz.org> wrote:
> + type pigz >/dev/null 2>&1 && compress="pigz"
Isn't the "type" builtin a feature of the bash shell? The buildtar
script won't necessarily be executed by bash.
Jim Davis <jim.epost@gmail.com> writes: > On Tue, Aug 16, 2016 at 6:35 AM, Dmitry Monakhov <dmonakhov@openvz.org> wrote: > >> + type pigz >/dev/null 2>&1 && compress="pigz" > > Isn't the "type" builtin a feature of the bash shell? The buildtar > script won't necessarily be executed by bash. Yes, you are right. Let's use '/usr/bin/which'. I'll resend new version. > > -- > Jim
diff --git a/scripts/package/buildtar b/scripts/package/buildtar index c64e6eb..d0d790f 100755 --- a/scripts/package/buildtar +++ b/scripts/package/buildtar @@ -29,14 +29,17 @@ case "${1}" in ;; targz-pkg) compress="gzip" + type pigz >/dev/null 2>&1 && compress="pigz" file_ext=".gz" ;; tarbz2-pkg) compress="bzip2" + type lbzip2 >/dev/null 2>&1 && compress="lbzip2" file_ext=".bz2" ;; tarxz-pkg) compress="xz" + type pxz >/dev/null 2>&1 && compress="pxz" file_ext=".xz" ;; *)
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> --- scripts/package/buildtar | 3 +++ 1 file changed, 3 insertions(+)