From 70dfbbd73f6db96cee15ee797ebd12a2fce2d082 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 22 Jan 2015 08:42:47 -0800 Subject: [PATCH] Bug 1106707 - Allow the variant to be mixed in with other params, r=coop --- scripts/spidermonkey_builds/spidermonkey.sh | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/scripts/spidermonkey_builds/spidermonkey.sh b/scripts/spidermonkey_builds/spidermonkey.sh index 5a0049a71..6c57fa2af 100755 --- a/scripts/spidermonkey_builds/spidermonkey.sh +++ b/scripts/spidermonkey_builds/spidermonkey.sh @@ -11,7 +11,9 @@ DEFAULT_REPO="https://hg.mozilla.org/integration/mozilla-inbound" function usage() { echo "Usage: $0 [-m mirror_url] [-b bundle_url] [-r revision] [--dep] variant" - echo "PROPERTIES_FILE must be set for an automation build" + if [ -z "$PROPERTIES_FILE" ]; then + echo "PROPERTIES_FILE must be set for an automation build" + fi } # It doesn't work to just pull from try. If you try to pull the full repo, @@ -20,7 +22,8 @@ function usage() { # --bundle and/or --mirror. hgtool_args=() noclean="" -while [ $# -gt 1 ]; do +VARIANT="" +while [ $# -gt 0 ]; do case "$1" in -m|--mirror) shift @@ -55,14 +58,22 @@ while [ $# -gt 1 ]; do shift ;; *) - echo "Invalid arguments" >&2 - usage - exit 1 + if [ -z "$VARIANT" ]; then + VARIANT="$1" + shift + else + echo "Invalid arguments: multiple variants detected" >&2 + usage + exit 1 + fi ;; esac done -VARIANT="$1" +if [ -z "$VARIANT" ]; then + usage + exit 1 +fi if [ -n "$PROPERTIES_FILE" ]; then if ! [ -f "$PROPERTIES_FILE" ]; then