[EMAIL PROTECTED] wrote:

> Added an unpack script - need to call it from each Makefile
<snip>
> +if echo $1 | grep -q "tar.gz" || echo $1 | grep -q ".tgz" ; then
> +     $TAR -xzvf $1 || echo "Error: Unpacking of \"$1\" failed."
> +elif echo $1 | grep -q "tar.bz2" ; then
> +     $TAR -xjvf $1 || echo "Error: Unpacking of \"$1\" failed."
> +elif [ `expr "$1" : '.*\(...\)'` = "tar" ] ; then
> +     $TAR -xvf $1 || echo "Error: Unpacking of \"$1\" failed."
> +else
> +     echo "Error: Bad format or unknown compression type"
> +fi

Why not instead just rely on automatic archive handling in modern versions of 
tar (1.15.1)?

tar xf any_file.tar.gz
tar xf any_file.tgz
tar xf any_file.tar.bz2

-- 
Alexander E. Patrakov
-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to