提交 be3ee240 authored 作者: Travis Cross's avatar Travis Cross

reindent

上级 44e6dd26
#!/bin/sh #!/bin/sh
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
TAR=@TAR@ TAR=@TAR@
ZCAT=@ZCAT@ ZCAT=@ZCAT@
...@@ -8,39 +9,39 @@ WGET=@WGET@ ...@@ -8,39 +9,39 @@ WGET=@WGET@
CURL=@CURL@ CURL=@CURL@
if [ -f "$WGET" ]; then if [ -f "$WGET" ]; then
DOWNLOAD_CMD=$WGET DOWNLOAD_CMD=$WGET
elif [ -f "$CURL" ]; then elif [ -f "$CURL" ]; then
DOWNLOAD_CMD="$CURL -O" DOWNLOAD_CMD="$CURL -O"
fi fi
if [ -n "`echo $1 | grep '://'`" ]; then if [ -n "`echo $1 | grep '://'`" ]; then
base=$1/ base=$1/
tarfile=$2 tarfile=$2
else else
base=http://files.freeswitch.org/downloads/libs/ base=http://files.freeswitch.org/downloads/libs/
tarfile=$1 tarfile=$1
fi fi
uncompressed=`echo $tarfile | sed 's/\(\(\.tar\.gz\|\.tar\.bz2\|\.tar\.xz\)\|\(\.tgz\|\.tbz2\)\)$//'` uncompressed=`echo $tarfile | sed 's/\(\(\.tar\.gz\|\.tar\.bz2\|\.tar\.xz\)\|\(\.tgz\|\.tbz2\)\)$//'`
case `echo $tarfile | sed 's/^.*\.//'` in case `echo $tarfile | sed 's/^.*\.//'` in
bz2|tbz2) UNZIPPER=$BZIP ;; bz2|tbz2) UNZIPPER=$BZIP ;;
xz) UNZIPPER=$XZ ;; xz) UNZIPPER=$XZ ;;
gz|tgz|*) UNZIPPER=$ZCAT ;; gz|tgz|*) UNZIPPER=$ZCAT ;;
esac esac
if [ ! -d $tarfile ]; then if [ ! -d $tarfile ]; then
if [ ! -f $tarfile ]; then
rm -fr $uncompressed
$DOWNLOAD_CMD $base$tarfile
if [ ! -f $tarfile ]; then if [ ! -f $tarfile ]; then
rm -fr $uncompressed echo cannot find $tarfile
$DOWNLOAD_CMD $base$tarfile exit 1
if [ ! -f $tarfile ]; then
echo cannot find $tarfile
exit 1
fi
fi
if [ ! -d $uncompressed ]; then
$UNZIPPER -c -d $tarfile | $TAR -xf -
fi fi
fi
if [ ! -d $uncompressed ]; then
$UNZIPPER -c -d $tarfile | $TAR -xf -
fi
fi fi
exit 0 exit 0
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论