Change fetch-pkg.mk to use case instead of if/elif etc.

This commit is contained in:
sin 2014-03-04 15:34:45 +00:00
parent 6cf0949e99
commit 713d7974ad

View File

@ -14,13 +14,20 @@ fetch-target:QP./stuff/cmp-fetch: .
wget -c $url
file=`basename $url`
type=`file -b $file | cut -d ' ' -f 1`
if test "$type" = "gzip"; then
case "$type" in
gzip)
tar -xzf $file
elif test "$type" = "bzip2"; then
;;
bzip2)
tar -xjf $file
elif test "$type" = "XZ"; then
;;
XZ)
tar -xJf $file
fi
;;
*)
echo "Unknown file type $type" 1>&2
exit 1
;;
esac
fi
cp $top/pkgs/$pkg $top/.cache/$target