diff options
Diffstat (limited to 'scripts/release/setup-workspace')
-rwxr-xr-x | scripts/release/setup-workspace | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/scripts/release/setup-workspace b/scripts/release/setup-workspace deleted file mode 100755 index 09da9dc1..00000000 --- a/scripts/release/setup-workspace +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------------------------------------------------- -# SPDX-License-Identifier: MIT -# --------------------------------------------------------------------------------------------------------------------- - -usage () { - echo >&2 "Usage: ${0##*/} [options]" - echo >&2 - echo >&2 "Options:" - echo >&2 " -w WORKSPACEDIR Specify the workspace directory to create (default: 'workspace'))" - echo >&2 " -m MANIFEST Specify a manifest, rather than interactive selection" - echo >&2 " -x EXTRA_MANIFEST Specify an extra manifest. To specify" - echo >&2 " multiple, use multiple -x arguments." - echo >&2 " -X Explicitly disable extra manifests" - echo >&2 " -h Show this usage information" - echo >&2 -} - -abspath () { - _path="$1" - if [ -n "${_path##/*}" ]; then - _path="${2:-$PWD}/$1" - fi - echo "$_path" -} - -if [ "$1" = "--help" ]; then - usage - exit 1 -fi - -WORKSPACEDIR=$PWD/workspace -manifest= -extra_disabled= -extra_manifests= -all_versions= -while getopts w:m:x:Xah opt; do - case "$opt" in - w) - WORKSPACEDIR="$OPTARG" - if [ -z "$WORKSPACEDIR" ]; then - echo >&2 "-w requires an argument" - exit 1 - else - WORKSPACEDIR="$(abspath "$WORKSPACEDIR")" - fi - ;; - m) - manifest="$OPTARG" - if [ -z "$manifest" ]; then - echo >&2 "-m requires an argument" - exit 1 - else - if [ ! -e "$manifest" ]; then - echo >&2 "Error: manifest path $manifest does not exist" - exit 1 - else - manifest="$(abspath "$manifest")" - fi - fi - ;; - X) - if [ -n "$extra_manifest" ]; then - echo >&2 "Error: -x and -X are mutually exclusive" - exit 1 - fi - extra_disabled=1 - ;; - x) - if [ -n "$extra_disabled" ]; then - echo >&2 "Error: -x and -X are mutually exclusive" - exit 1 - fi - - extra_manifest="$OPTARG" - if [ -z "$extra_manifest" ]; then - echo >&2 "-x requires an argument" - exit 1 - else - if [ ! -e "$extra_manifest" ]; then - echo >&2 "Error: extra_manifest path $extra_manifest does not exist" - exit 1 - else - extra_manifests="$extra_manifests $(abspath "$extra_manifest")" - fi - fi - ;; - a) - all_versions=1 - ;; - \? | h) - usage - exit 1 - ;; - esac -done -shift $((OPTIND - 1)) - -if [ -e "$WORKSPACEDIR" ]; then - existing_workspace=1 -else - existing_workspace=0 -fi - -scriptdir="$(dirname "$0")" -"$scriptdir/mel-checkout" ${all_versions:+-a} ${extra_disabled:+-X} "$WORKSPACEDIR" "$manifest" $extra_manifests \ - && cd "$WORKSPACEDIR" -if [ $? -ne 0 ]; then - if [ $existing_workspace -eq 0 ]; then - # New workspace, clean up on failure - rm -r "$WORKSPACEDIR" - fi - exit 1 -fi |