Commit ab24002a authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Ajuste para apagar arquivos baixados na instalação.

[SOMA-7020][SOMA-6957]
parent d08972da
......@@ -4,6 +4,7 @@ usage() {
echo "usage: $0 [options] path"
echo "Available options are:"
echo " --force Just show warnings, but don't stop execution."
echo " --nocleanup Do not delete downloaded files on success."
echo " --rocks <repoUrl> Use rocks from the provided LuaRocks repository."
echo " --posix Install the POSIX driver."
echo " --pbs Install the PBS driver (experimental)."
......@@ -11,6 +12,7 @@ usage() {
}
WARNING=no
CLEANUP=yes
warn() {
echo "$0: $1"
......@@ -29,6 +31,20 @@ download() {
tar -xzvf "$tarball"
}
cleandownload() {
if [[ ${CLEANUP} == "yes" && ! -z "$1" ]]
then
if [ -e "$1.tar.gz" ]
then
rm "$1.tar.gz"
fi
if [ -d "$1/" ]
then
rm -fR "$1/"
fi
fi
}
ROCK_REPO="http://www.tecgraf.puc-rio.br/ftp_pub/csbase/sga-rest/luarocks"
SGA_HOME=""
SGA_DRIVERS=""
......@@ -39,6 +55,10 @@ do
WARNING=yes
shift
;;
--nocleanup)
CLEANUP=no
shift
;;
--rocks)
shift
ROCK_REPO="$1"
......@@ -133,3 +153,5 @@ do
esac
done
cleandownload "${LUA_VERSION}"
cleandownload "${LUAROCKS_VERSION}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment