Browse Source

Removing header hooks, as they're useless

Considering finish hooks, to only update the rev file if compile was successful for vcs. Not sure yet.
master
mid-kid 9 years ago
parent
commit
9afbf19ae7
  1. 19
      astronaut/astronaut
  2. 10
      astronaut/functions/say_hello.sh
  3. 34
      satellites/functions/vcs/git.sh
  4. 2
      satellites/vcs/armips.sat
  5. 3
      satellites/vcs/ctr.sat
  6. 3
      satellites/vcs/ctrff.sat
  7. 3
      satellites/vcs/ctrtool.sat
  8. 3
      satellites/vcs/ctrulib-git.sat
  9. 3
      satellites/vcs/makerom.sat
  10. 4
      satellites/vcs/neovim-git.sat
  11. 2
      satellites/vcs/sockfile.sat

19
astronaut/astronaut

@ -157,25 +157,13 @@ do_check() {
} }
import() { import() {
unset _hooks
. "$(dirname "$_satellite")/functions/$1.sh" . "$(dirname "$_satellite")/functions/$1.sh"
if [ "$_hooks" ]; then
_header_end_hooks="$_header_end_hooks $_hooks"
fi
}
_run_header_end_hooks() {
for _hook in $_header_end_hooks; do
$_hook
done
unset _hook
} }
# Set some functions in accordance to the _download_only option. # Set some functions in accordance to the _download_only option.
header_end() { _run_header_end_hooks; } header_end() { :; }
if [ "$_vcs_only" = true ]; then if [ "$_vcs_only" = true ]; then
header_end() { header_end() {
_run_header_end_hooks
if [ ! "$vcs_compile" = true ]; then if [ ! "$vcs_compile" = true ]; then
exit exit
fi fi
@ -188,10 +176,7 @@ if [ "$_download_only" = true ]; then
extrafile() { :; } extrafile() { :; }
# Exit at the end of the header # Exit at the end of the header
header_end() { header_end() { exit; }
_run_header_end_hooks
exit
}
fi fi
_satellite="$(realpath "$1")" _satellite="$(realpath "$1")"

10
astronaut/functions/say_hello.sh

@ -6,13 +6,3 @@ say_hello() {
_func_tmp="Hello, there!" _func_tmp="Hello, there!"
echo "Function ran! $_func_tmp" echo "Function ran! $_func_tmp"
} }
# Any hook is prefixed with "_hook_"
_hook_hello() {
echo "The hook ran at header_end!"
}
# This is a space-separated list of all the hooks.
_hooks="_hook_hello"
# Hooks are functions with code that is run at header_end, regardless if you're in download-only mode. So don't go messing in the build directory here.
# This is purely to set variables (like update_url), maybe download code, or something else.

34
satellites/functions/vcs/git.sh

@ -1,22 +1,26 @@
vcs_git() { vcs_git() {
if [ ! -d "$dir_source/$name/vcs" ]; then _func_reponame="$(basename "$1")"
rm -rf "$dir_source/$name/vcs" _func_dir="$dir_source/$name/$_func_reponame"
git clone --recursive --depth=1 "$1" "$dir_source/$name/vcs"
vcs_compile=true
fi
}
_hook_git() {
cd "$dir_source/$name/vcs"
git pull > /dev/null if [ ! -d "$_func_dir" ]; then
_func_rev="$(git rev-parse @)" # Clone new repo
if [ "$_func_rev" != "$(cat "$dir_source/$name/vcs_rev_$_satname" 2> /dev/null || true)" ]; then git clone --recursive --depth=1 "$1" "$_func_dir"
echo "$_func_rev" > "$dir_source/$name/vcs_rev_$_satname" cd "$_func_dir"
echo "$(git rev-parse @)" > "${_func_dir}_rev_$_satname"
vcs_compile=true vcs_compile=true
else
cd "$_func_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"
vcs_compile=true
fi
fi fi
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"
}
_hooks="_hook_git" getfile "$_func_dir"
}

2
satellites/vcs/armips.sat

@ -6,7 +6,7 @@ name=armips
vcs_git "https://github.com/Kingcom/$name" vcs_git "https://github.com/Kingcom/$name"
header_end header_end
getfile vcs; cd vcs cd "$name"
compile_cmake_installbin "$name" compile_cmake_installbin "$name"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

3
satellites/vcs/ctr.sat

@ -5,8 +5,7 @@ name=ctr
vcs_git "https://github.com/b1l1s/$name" vcs_git "https://github.com/b1l1s/$name"
header_end header_end
getfile vcs; cd vcs cd "$name"
mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/lib" mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/lib"
make DEVKITARM="$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM" install make DEVKITARM="$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM" install

3
satellites/vcs/ctrff.sat

@ -5,8 +5,7 @@ name=ctrff
vcs_git "https://github.com/b1l1s/$name" vcs_git "https://github.com/b1l1s/$name"
header_end header_end
getfile vcs; cd vcs cd "$name"
mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/lib" mkdir -p "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/include" "$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM/arm-none-eabi/lib"
make DEVKITARM="$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM" install make DEVKITARM="$dir_install/$dir_sysroot/opt/devkitPRO/devkitARM" install

3
satellites/vcs/ctrtool.sat

@ -5,8 +5,7 @@ name=Project_CTR
vcs_git "https://github.com/profi200/$name" vcs_git "https://github.com/profi200/$name"
header_end header_end
getfile vcs; cd vcs/ctrtool cd "$name/ctrtool"
make make
install -D ctrtool "$dir_install/$dir_prefix/bin/ctrtool" install -D ctrtool "$dir_install/$dir_prefix/bin/ctrtool"

3
satellites/vcs/ctrulib-git.sat

@ -5,8 +5,7 @@ name=ctrulib
vcs_git "https://github.com/smealum/$name" vcs_git "https://github.com/smealum/$name"
header_end header_end
getfile vcs; cd vcs/libctru cd "$name/libctru"
make DEVKITPRO="$dir_install/$dir_sysroot/opt/devkitPRO" install make DEVKITPRO="$dir_install/$dir_sysroot/opt/devkitPRO" install
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

3
satellites/vcs/makerom.sat

@ -5,8 +5,7 @@ name=Project_CTR
vcs_git "https://github.com/profi200/$name" vcs_git "https://github.com/profi200/$name"
header_end header_end
getfile vcs; cd vcs/makerom cd "$name/makerom"
make make
install -D makerom "$dir_install/$dir_prefix/bin/makerom" install -D makerom "$dir_install/$dir_prefix/bin/makerom"

4
satellites/vcs/neovim-git.sat

@ -3,10 +3,10 @@ import "vcs/git"
name=neovim name=neovim
vcs_git "https://github.com/neovim/neovim" vcs_git "https://github.com/$name/$name"
header_end header_end
getfile vcs; cd vcs cd "$name"
make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX='$dir_prefix'" make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX='$dir_prefix'"
make DESTDIR="$dir_install" install make DESTDIR="$dir_install" install

2
satellites/vcs/sockfile.sat

@ -6,7 +6,7 @@ name=sockfile
vcs_git "https://github.com/mid-kid/$name" vcs_git "https://github.com/mid-kid/$name"
header_end header_end
getfile vcs; cd vcs cd "$name"
compile_cmake_installbin "$name" compile_cmake_installbin "$name"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et: # vim:set tabstop=4 shiftwidth=4 syntax=sh et:

Loading…
Cancel
Save