Skip to content

Commit

Permalink
backporting: Stop scripts from running on non-Linux
Browse files Browse the repository at this point in the history
This is mainly for the benefit of macOS users typing in the wrong
terminal.

Signed-off-by: Tom Payne <tom@isovalent.com>
  • Loading branch information
twpayne authored and fristonio committed Nov 16, 2020
1 parent a553f79 commit 05eabc7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/backporting/check-stable
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ source $(dirname $(readlink -ne $BASH_SOURCE))/../release/lib/common.sh
source $TOOL_LIB_PATH/gitlib.sh
source $(dirname $(readlink -ne $BASH_SOURCE))/common.sh

require_linux

# Validate command-line
common::argc_validate 2

Expand Down
2 changes: 2 additions & 0 deletions contrib/backporting/cherry-pick
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -e

source $(dirname $(readlink -ne $BASH_SOURCE))/common.sh

require_linux

cleanup () {
if [ -n "$TMPF" ]; then
rm $TMPF
Expand Down
7 changes: 7 additions & 0 deletions contrib/backporting/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ get_remote () {
fi
echo "$remote"
}

require_linux() {
if [ "$(uname)" != "Linux" ]; then
echo "$0: Linux required"
exit 1
fi
}
2 changes: 2 additions & 0 deletions contrib/backporting/start-backport
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ source $(dirname $(readlink -ne $BASH_SOURCE))/../release/lib/common.sh
source $TOOL_LIB_PATH/gitlib.sh
source $(dirname $(readlink -ne $BASH_SOURCE))/common.sh

require_linux

# Validate command-line
common::argc_validate 1

Expand Down
2 changes: 2 additions & 0 deletions contrib/backporting/submit-backport
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ DIR=$(dirname $(readlink -ne $BASH_SOURCE))
source $DIR/../release/lib/common.sh
source $DIR/common.sh

require_linux

BRANCH="${1:-}"
if [ "$BRANCH" = "" ]; then
BRANCH=$(git symbolic-ref --short HEAD | sed 's/.*\(v[0-9]\.[0-9]\).*/\1/')
Expand Down

0 comments on commit 05eabc7

Please sign in to comment.