Browse Source

I honestly forgot locals were a thing

master
mid-kid 9 years ago
parent
commit
0857dddd72
  1. 5
      astronaut/functions/say_hello.sh
  2. 4
      satellites/functions/compile/cmake.sh
  3. 4
      satellites/functions/compile/python.sh
  4. 4
      satellites/functions/compile/qt.sh
  5. 14
      satellites/functions/download/git.sh
  6. 22
      satellites/functions/vcs/git.sh

5
astronaut/functions/say_hello.sh

@ -2,7 +2,6 @@
# You define a function here, and it becomes available in any script that imports it. # You define a function here, and it becomes available in any script that imports it.
say_hello() { say_hello() {
# Any function or variable that shouldn't be seen by the satellite is prefixed with "_func_" local tmp="Hello, there!"
_func_tmp="Hello, there!" echo "Function ran! $tmp"
echo "Function ran! $_func_tmp"
} }

4
satellites/functions/compile/cmake.sh

@ -10,7 +10,7 @@ compile_cmake() {
} }
compile_cmake_installbin() { compile_cmake_installbin() {
_func_file="$1"; shift local file="$1"; shift
compile_cmake_base $@ compile_cmake_base $@
install -D "$_func_file" "$dir_install/$dir_prefix/bin/$_func_file" install -D "$file" "$dir_install/$dir_prefix/bin/$_func_file"
} }

4
satellites/functions/compile/python.sh

@ -1,4 +1,4 @@
compile_python() { compile_python() {
_func_ver="$1"; shift local ver="$1"; shift
python$_func_ver setup.py install --prefix="$dir_prefix" --root="$dir_install" $@ python$ver setup.py install --prefix="$dir_prefix" --root="$dir_install" $@
} }

4
satellites/functions/compile/qt.sh

@ -1,6 +1,6 @@
compile_qt() { compile_qt() {
_func_ver="$1"; shift local ver="$1"; shift
qmake-qt$_func_ver PREFIX="$dir_prefix" build_mode=release build_type=shared $@ qmake-qt$ver PREFIX="$dir_prefix" build_mode=release build_type=shared $@
make make
make INSTALL_ROOT="$dir_install" install make INSTALL_ROOT="$dir_install" install
} }

14
satellites/functions/download/git.sh

@ -1,15 +1,15 @@
download_git() { download_git() {
_func_reponame="$(basename "$1")" local reponame="$(basename "$1")"
_func_dir="$dir_source/$name/$_func_reponame-$2" local dir="$dir_source/$name/$_func_reponame-$2"
if [ ! -d "$_func_dir" ]; then if [ ! -d "$dir" ]; then
rm -rf "$_func_dir" rm -rf "$dir"
git clone --recursive --depth=1 -b "v$2" "$1" "$_func_dir" git clone --recursive --depth=1 -b "v$2" "$1" "$dir"
else else
cd "$_func_dir" cd "$dir"
git checkout "tags/v$2" git checkout "tags/v$2"
cd "$OLDPWD" cd "$OLDPWD"
fi fi
getfile "$_func_reponame-$2" getfile "$reponame-$2"
} }

22
satellites/functions/vcs/git.sh

@ -1,20 +1,20 @@
vcs_git() { vcs_git() {
_func_reponame="$(basename "$1")" local reponame="$(basename "$1")"
_func_dir="$dir_source/$name/$_func_reponame" local dir="$dir_source/$name/$reponame"
if [ ! -d "$_func_dir" ]; then if [ ! -d "$dir" ]; then
# Clone new repo # Clone new repo
git clone --recursive --depth=1 "$1" "$_func_dir" git clone --recursive --depth=1 "$1" "$dir"
cd "$_func_dir" cd "$dir"
echo "$(git rev-parse @)" > "${_func_dir}_rev_$_satname" echo "$(git rev-parse @)" > "${dir}_rev_$_satname"
vcs_compile=true vcs_compile=true
else else
cd "$_func_dir" cd "$dir"
git pull > /dev/null git pull > /dev/null
_func_rev="$(git rev-parse @)" local rev="$(git rev-parse @)"
if [ "$_func_rev" != "$(cat "${_func_dir}_rev_$_satname" 2> /dev/null || true)" ]; then if [ "$rev" != "$(cat "${dir}_rev_$_satname" 2> /dev/null || true)" ]; then
echo "$_func_rev" > "${_func_dir}_rev_$_satname" echo "$rev" > "${dir}_rev_$_satname"
vcs_compile=true vcs_compile=true
fi fi
fi fi
@ -22,5 +22,5 @@ vcs_git() {
version="$(git rev-list HEAD --count)_$(git rev-parse --short HEAD)" version="$(git rev-list HEAD --count)_$(git rev-parse --short HEAD)"
cd "$OLDPWD" cd "$OLDPWD"
getfile "$_func_reponame" getfile "$reponame"
} }

Loading…
Cancel
Save