6 if [ ! -x "$tar" ]; then
8 if [ ! -x "$tar" ]; then
9 # echo nothing: no suitable tar found
14 # Output of 'tar --version' examples:
15 # tar (GNU tar) 1.15.1
17 # bsdtar 2.8.3 - libarchive 2.8.3
18 version
=`$tar --version | head -n 1 | sed 's/^.*\s\([0-9]\+\.\S\+\).*$/\1/'`
19 major
=`echo "$version" | cut -d. -f1`
20 minor
=`echo "$version" | cut -d. -f2`
21 bugfix
=`echo "$version" | cut -d. -f3`
22 version_bsd
=`$tar --version | grep 'bsdtar'`
23 if [ ! -z "${version_bsd}" ] ; then
24 # mark as invalid version - not all command line options are available
29 # Minimal version = 1.17 (previous versions do not correctly unpack archives
30 # containing hard-links if the --strip-components option is used).
33 if [ $major -gt $major_min ]; then
36 if [ $major -eq $major_min -a $minor -ge $minor_min ]; then
39 # echo nothing: no suitable tar found