diff --git a/astronaut/functions/say_hello.sh b/astronaut/functions/say_hello.sh index 5a90a9d..82ede6d 100644 --- a/astronaut/functions/say_hello.sh +++ b/astronaut/functions/say_hello.sh @@ -2,7 +2,6 @@ # You define a function here, and it becomes available in any script that imports it. say_hello() { - # Any function or variable that shouldn't be seen by the satellite is prefixed with "_func_" - _func_tmp="Hello, there!" - echo "Function ran! $_func_tmp" + local tmp="Hello, there!" + echo "Function ran! $tmp" } diff --git a/satellites/functions/compile/cmake.sh b/satellites/functions/compile/cmake.sh index 4b2f026..8ef5b73 100644 --- a/satellites/functions/compile/cmake.sh +++ b/satellites/functions/compile/cmake.sh @@ -10,7 +10,7 @@ compile_cmake() { } compile_cmake_installbin() { - _func_file="$1"; shift + local file="$1"; shift compile_cmake_base $@ - install -D "$_func_file" "$dir_install/$dir_prefix/bin/$_func_file" + install -D "$file" "$dir_install/$dir_prefix/bin/$_func_file" } diff --git a/satellites/functions/compile/python.sh b/satellites/functions/compile/python.sh index 72e9eef..0486bde 100644 --- a/satellites/functions/compile/python.sh +++ b/satellites/functions/compile/python.sh @@ -1,4 +1,4 @@ compile_python() { - _func_ver="$1"; shift - python$_func_ver setup.py install --prefix="$dir_prefix" --root="$dir_install" $@ + local ver="$1"; shift + python$ver setup.py install --prefix="$dir_prefix" --root="$dir_install" $@ } diff --git a/satellites/functions/compile/qt.sh b/satellites/functions/compile/qt.sh index 4d211e6..d2feda2 100644 --- a/satellites/functions/compile/qt.sh +++ b/satellites/functions/compile/qt.sh @@ -1,6 +1,6 @@ compile_qt() { - _func_ver="$1"; shift - qmake-qt$_func_ver PREFIX="$dir_prefix" build_mode=release build_type=shared $@ + local ver="$1"; shift + qmake-qt$ver PREFIX="$dir_prefix" build_mode=release build_type=shared $@ make make INSTALL_ROOT="$dir_install" install } diff --git a/satellites/functions/download/git.sh b/satellites/functions/download/git.sh index 8017c2d..2b14b3c 100644 --- a/satellites/functions/download/git.sh +++ b/satellites/functions/download/git.sh @@ -1,15 +1,15 @@ download_git() { - _func_reponame="$(basename "$1")" - _func_dir="$dir_source/$name/$_func_reponame-$2" + local reponame="$(basename "$1")" + local dir="$dir_source/$name/$_func_reponame-$2" - if [ ! -d "$_func_dir" ]; then - rm -rf "$_func_dir" - git clone --recursive --depth=1 -b "v$2" "$1" "$_func_dir" + if [ ! -d "$dir" ]; then + rm -rf "$dir" + git clone --recursive --depth=1 -b "v$2" "$1" "$dir" else - cd "$_func_dir" + cd "$dir" git checkout "tags/v$2" cd "$OLDPWD" fi - getfile "$_func_reponame-$2" + getfile "$reponame-$2" } diff --git a/satellites/functions/vcs/git.sh b/satellites/functions/vcs/git.sh index b5b82a4..cdd3157 100644 --- a/satellites/functions/vcs/git.sh +++ b/satellites/functions/vcs/git.sh @@ -1,20 +1,20 @@ vcs_git() { - _func_reponame="$(basename "$1")" - _func_dir="$dir_source/$name/$_func_reponame" + local reponame="$(basename "$1")" + local dir="$dir_source/$name/$reponame" - if [ ! -d "$_func_dir" ]; then + if [ ! -d "$dir" ]; then # Clone new repo - git clone --recursive --depth=1 "$1" "$_func_dir" - cd "$_func_dir" - echo "$(git rev-parse @)" > "${_func_dir}_rev_$_satname" + git clone --recursive --depth=1 "$1" "$dir" + cd "$dir" + echo "$(git rev-parse @)" > "${dir}_rev_$_satname" vcs_compile=true else - cd "$_func_dir" + cd "$dir" git pull > /dev/null - _func_rev="$(git rev-parse @)" - if [ "$_func_rev" != "$(cat "${_func_dir}_rev_$_satname" 2> /dev/null || true)" ]; then - echo "$_func_rev" > "${_func_dir}_rev_$_satname" + local rev="$(git rev-parse @)" + if [ "$rev" != "$(cat "${dir}_rev_$_satname" 2> /dev/null || true)" ]; then + echo "$rev" > "${dir}_rev_$_satname" vcs_compile=true fi fi @@ -22,5 +22,5 @@ vcs_git() { version="$(git rev-list HEAD --count)_$(git rev-parse --short HEAD)" cd "$OLDPWD" - getfile "$_func_reponame" + getfile "$reponame" }