about summary refs log tree commit diff
path: root/src/ci/scripts
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2021-05-12 12:15:39 +0200
committerPietro Albini <pietro@pietroalbini.org>2021-05-12 12:15:39 +0200
commita8da3335e6e6f6d6ad8500205ded61a5351dc2b4 (patch)
tree80f7a3da3fe207969698b6c73ebd713311e56926 /src/ci/scripts
parent392723ec6e643f694a66e47941e5c8ae670e219f (diff)
downloadrust-a8da3335e6e6f6d6ad8500205ded61a5351dc2b4.tar.gz
rust-a8da3335e6e6f6d6ad8500205ded61a5351dc2b4.zip
make verify-channel.sh compatible with macOS
Diffstat (limited to 'src/ci/scripts')
-rwxr-xr-xsrc/ci/scripts/verify-channel.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/ci/scripts/verify-channel.sh b/src/ci/scripts/verify-channel.sh
index 7945512738e..d02dc362c63 100755
--- a/src/ci/scripts/verify-channel.sh
+++ b/src/ci/scripts/verify-channel.sh
@@ -8,21 +8,31 @@ IFS=$'\n\t'
 
 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
 
-declare -A CHANNEL_BRANCH
-CHANNEL_BRANCH["nightly"]="master"
-CHANNEL_BRANCH["beta"]="beta"
-CHANNEL_BRANCH["stable"]="stable"
-
 if isCiBranch auto || isCiBranch try; then
     echo "channel verification is only executed on PR builds"
     exit
 fi
 
 channel=$(cat "$(ciCheckoutPath)/src/ci/channel")
+case "${channel}" in
+    nightly)
+        channel_branch="master"
+        ;;
+    beta)
+        channel_branch="beta"
+        ;;
+    stable)
+        channel_branch="stable"
+        ;;
+    *)
+        echo "error: unknown channel defined in src/ci/channel: ${channel}"
+        exit 1
+esac
+
 branch="$(ciBaseBranch)"
-if [[ "${branch}" != "${CHANNEL_BRANCH[$channel]}" ]]; then
+if [[ "${branch}" != "${channel_branch}" ]]; then
     echo "error: PRs changing the \`${channel}\` channel should be sent to the \
-\`${CHANNEL_BRANCH[$channel]}\` branch!"
+\`${channel_branch}\` branch!"
 
     exit 1
 fi