[archivers] xzize: shellcheck

This commit is contained in:
Matteo Cypriani 2019-10-28 15:57:21 +01:00
parent dbb0d6bf3a
commit 3fb819f430
1 changed files with 12 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# xzize.sh, Copyright © 2010 Matteo Cypriani # xzize.sh, Copyright © 2010, 2019 Matteo Cypriani
# #
# This program is free software. It comes without any warranty, to # This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it # the extent permitted by applicable law. You can redistribute it
@ -16,12 +16,12 @@
# file is removed. # file is removed.
# If the file is already XZ compressed (.xz, .txz), nothing is done. # If the file is already XZ compressed (.xz, .txz), nothing is done.
#set -x
set -u set -u
# Destination file suffix when source file name suffix is a # Destination file suffix when source file name suffix is a
# 3-letter compressed tar suffix: # 3-letter compressed tar suffix:
TAR_XZ_EXT=txz readonly TAR_XZ_EXT=txz
# Default compression level: # Default compression level:
COMPRESSION_LEVEL= COMPRESSION_LEVEL=
@ -83,63 +83,63 @@ for SOURCE in "$@" ; do
# GZip # GZip
if test_extension "$SOURCE" gz ; then if test_extension "$SOURCE" gz ; then
ACTION=gunzip ACTION="gunzip"
do_recompress do_recompress
continue continue
fi fi
# GZipped Tar (.tgz) # GZipped Tar (.tgz)
if test_extension "$SOURCE" tgz $TAR_XZ_EXT ; then if test_extension "$SOURCE" tgz $TAR_XZ_EXT ; then
ACTION=gunzip ACTION="gunzip"
do_recompress do_recompress
continue continue
fi fi
# BZip2 # BZip2
if test_extension "$SOURCE" bz2 ; then if test_extension "$SOURCE" bz2 ; then
ACTION=bunzip2 ACTION="bunzip2"
do_recompress do_recompress
continue continue
fi fi
# BZipped Tar (.tbz) # BZipped Tar (.tbz)
if test_extension "$SOURCE" tbz $TAR_XZ_EXT ; then if test_extension "$SOURCE" tbz $TAR_XZ_EXT ; then
ACTION=bunzip2 ACTION="bunzip2"
do_recompress do_recompress
continue continue
fi fi
# BZipped Tar (.tb2) # BZipped Tar (.tb2)
if test_extension "$SOURCE" tb2 $TAR_XZ_EXT ; then if test_extension "$SOURCE" tb2 $TAR_XZ_EXT ; then
ACTION=bunzip2 ACTION="bunzip2"
do_recompress do_recompress
continue continue
fi fi
# LZMA # LZMA
if test_extension "$SOURCE" lzma ; then if test_extension "$SOURCE" lzma ; then
ACTION=unlzma ACTION="unlzma"
do_recompress do_recompress
continue continue
fi fi
# LZMA compressed Tar (.tlz) # LZMA compressed Tar (.tlz)
if test_extension "$SOURCE" tlz $TAR_XZ_EXT ; then if test_extension "$SOURCE" tlz $TAR_XZ_EXT ; then
ACTION=unlzma ACTION="unlzma"
do_recompress do_recompress
continue continue
fi fi
# Compress # Compress
if test_extension "$SOURCE" Z ; then if test_extension "$SOURCE" Z ; then
ACTION=uncompress ACTION="uncompress"
do_recompress do_recompress
continue continue
fi fi
# Compressed Tar (.taz) # Compressed Tar (.taz)
if test_extension "$SOURCE" taz $TAR_XZ_EXT ; then if test_extension "$SOURCE" taz $TAR_XZ_EXT ; then
ACTION=uncompress ACTION="uncompress"
do_recompress do_recompress
continue continue
fi fi