summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2015-03-13 13:41:51 +0100
committerYvan Roux <yvan.roux@linaro.org>2015-03-13 13:41:51 +0100
commit76b0cb234f31367e05f63a2bfb2f1be650740f28 (patch)
tree9bf6f75803bce7c631243e57cc23281bdf9e2927
parent65b2fd241d17bdff8d29e73ee2796c40c5c9b851 (diff)
downloadbackflip-76b0cb234f31367e05f63a2bfb2f1be650740f28.tar.gz
Add Configuration checking step:
* git repo * gerrit
-rwxr-xr-xbackflip22
1 files changed, 22 insertions, 0 deletions
diff --git a/backflip b/backflip
index 7acbe90..31cb120 100755
--- a/backflip
+++ b/backflip
@@ -37,6 +37,11 @@ print_info() {
echo -e "${blue}** ${NC}${1}"
}
+die() {
+ echo -e "${red}${bold}ERROR: ${NC}${bold}${1}${NC}"
+ exit 1
+}
+
# arg1 : a sentence
# arg2 : a variable
# print arg1 and gather user input in arg2
@@ -63,6 +68,23 @@ forge_entry() {
}
# ==============================================================================
+print_step "Checking Configuration"
+# ==============================================================================
+if ! git remote -v 2>&1 | grep "git@git.linaro.org" > /dev/null ; then
+ die "You're not in the right directory !"
+fi
+if [ ! -e .gitreview ]; then
+ print_info "Gerrit configuration (.gitreview) is missing, creating it."
+ cat <<- EOF > .gitreview
+[gerrit]
+host=review.linaro.org
+port=29418
+project=toolchain/gcc
+EOF
+fi
+print_info "${bold}OK${NC}"
+
+# ==============================================================================
print_step "Finding SHA1"
# ==============================================================================
SHA1=`git log --format=format:"%H" --grep=trunk@${1} master`