diff --git a/maintainers/patches b/maintainers/patches new file mode 100755 index 0000000..89b3e52 --- /dev/null +++ b/maintainers/patches @@ -0,0 +1,82 @@ +#!/bin/zsh + +PROGRAM=$0 + +success() { + echo "\e[1;32mDone:\e[m $1" + exit 0 +} + +fail() { + echo "\e[1;31mError:\e[m $1" + exit 1 +} + +help() { + cat < ../../patches/tock/${file#*-} + done + git clean -qfxd + top=$(get_head) + git checkout -q $root + rm -r boards + patch -sp1 < ../../patches/tock/00-boards.patch + rm ../../patches/tock/00-boards.patch + rsync -a --delete boards ../.. + git reset -q --hard + git clean -qfxd + git checkout -q $top + ) || exit + success 'Saved the Tock submodule to the patches.' +} + +[[ $(basename $PWD) == OpenSK ]] || fail 'Not running from OpenSK directory.' +[[ $# -eq 1 ]] || help +case $1 in + apply) apply ;; + save) save ;; + *) fail 'Unexpected argument. Run without argument for help.' ;; +esac diff --git a/reproduce_board.sh b/maintainers/reproduce_board.sh similarity index 100% rename from reproduce_board.sh rename to maintainers/reproduce_board.sh diff --git a/reproduce_hashes.sh b/maintainers/reproduce_hashes.sh similarity index 100% rename from reproduce_hashes.sh rename to maintainers/reproduce_hashes.sh diff --git a/update_hashes.sh b/maintainers/update_hashes.sh similarity index 100% rename from update_hashes.sh rename to maintainers/update_hashes.sh