aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorNelson Castillo <arhuaco@freaks-unidos.net>2009-02-20 13:33:31 +0000
committerAndy Green <agreen@octopus.localdomain>2009-02-20 13:33:31 +0000
commita218b8640bc3aaa4123f230d1549d53f6ab9a01f (patch)
tree7d0ee588ec4c3c8c184fcbc5241594366821cdf5 /build
parent6d5e7fd806eb2e191a1b3994b88b943e88a8beb5 (diff)
'build' script: complain if we are not in a valid branch
This is a known problem and it is starting to become a FAQ. People get an error message when they try to build a kernel and they are not in a valid branch of their local repository. When it happens git-branch will print something like: * (no branch) andy-tracking balaji-tracking With this patch we make sure we are in a valid branch when building the kernel using the build script in order to avoid OM developers some trouble. How? We print a nice message if we are not in a valid branch and then stop. Please feel free to edit the error message if you think it is not clear enough. Thanks to Werner Almesberger for his advice on shell scripting. Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'build')
-rwxr-xr-xbuild12
1 files changed, 12 insertions, 0 deletions
diff --git a/build b/build
index 58e24c7e624..34a34ed6a11 100755
--- a/build
+++ b/build
@@ -64,6 +64,18 @@ if [ -z "$PRODUCT" ] ; then
fi
#
+# check that we are in a valid branch
+#
+
+if git-branch | head -n1 | grep -q "* (no branch)"; then
+ cat <<EOF 1>&2
+There is no branch in the local copy of the repository right now!
+Hint: type git-branch, make sure you are in a valid branch and then try again
+EOF
+ exit 1
+fi;
+
+#
# get the branch and head hash for the version we are building to
# allow source tracability
#