[Asterisk-code-review] releaser.sh: Clean it up (repotools[master])
George Joseph
asteriskteam at digium.com
Fri Apr 7 09:20:36 CDT 2017
George Joseph has uploaded a new change for review. ( https://gerrit.asterisk.org/5426 )
Change subject: releaser.sh: Clean it up
......................................................................
releaser.sh: Clean it up
Remove the initial prompt and sleep.
Make options like other scripts.
Change-Id: I820bed6fdc04839458610a546a8d3b47555d35ec
---
M releaser.sh
1 file changed, 41 insertions(+), 24 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/26/5426/1
diff --git a/releaser.sh b/releaser.sh
index 0c3130f..628c3d9 100755
--- a/releaser.sh
+++ b/releaser.sh
@@ -1,30 +1,47 @@
#!/bin/bash
-echo "If you haven't already moved the files from pending/ to downloads-asterisk/ -- do that now!"
-echo ""
-echo "Hit CTRL-C if you haven't done it."
-sleep 3
+TYPE=release
-if [ $# -ne 5 ]; then
- echo "You need to provide the version number to add and to remove."
- echo ""
- echo "Try something like:"
- echo " releaser.sh 1.4.26 1.4.25.1 1.4 release asterisk"
- echo " or"
- echo " releaser.sh 1.4.26-rc2 1.4.26-rc1 1.4 RC asterisk-addons"
- echo " or"
- echo " releaser.sh 1.6.0 1.5.0 dont_care release libpri"
- echo " or"
- echo " releaser.sh 2.0.0 2.1.0 2.0 release libss7"
- echo " the format is"
- echo " releaser.sh NEW_VERSION OLD_VERSION BRANCH TYPE PROJECT"
- exit;
-else
- NEW_VERSION=$1
- OLD_VERSION=$2
- BRANCH=$3
- TYPE=$4
- PROJECT=$5
+while [ ${#@} -gt 0 ] ; do
+ case ${1} in
+ -o)
+ shift
+ OLD_VERSION=$1
+ ;;
+ -v)
+ shift
+ NEW_VERSION=$1
+ ;;
+ -b)
+ shift
+ BRANCH=$1
+ ;;
+ --rc)
+ TYPE=RC
+ ;;
+ -p)
+ shift
+ PROJECT=$1
+ ;;
+ *)
+ echo "releaser.sh -o <old_version> -v <new_version> -b <branch> -p <project> [ --rc ]"
+ exit 1;
+ ;;
+ esac
+ shift
+done
+
+FAIL=0
+
+[ -z "$OLD_VERSION" ] && FAIL=1
+[ -z "$NEW_VERSION" ] && FAIL=1
+[ -z "$BRANCH" ] && FAIL=1
+[ -z "$PROJECT" ] && FAIL=1
+
+if [ $FAIL -gt 0 ] ; then
+ echo "Missing parameters!"
+ echo "releaser.sh -o <old_version> -v <new_version> -b <branch> -p <project> [ --rc ]"
+ exit 1;
fi
commit_changes () {
--
To view, visit https://gerrit.asterisk.org/5426
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I820bed6fdc04839458610a546a8d3b47555d35ec
Gerrit-PatchSet: 1
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>
More information about the asterisk-code-review
mailing list