]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel-yocto: Disable ANSI escape codes from git branch
authorMatt Fleming <matt.fleming@intel.com>
Thu, 6 Mar 2014 11:04:34 +0000 (11:04 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Mar 2014 14:44:25 +0000 (14:44 +0000)
'git branch' may use ANSI escape codes in its output (to provide colour)
which doesn't play well with commands expecting pure plain text, e.g.

    fatal: '^[[31mmaster^[[m' is not a valid branch name.

Use the --no-color option to ensure all branch names are plain text.

Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel-yocto.bbclass

index fb8e04e704fb905ca38657dc70d16a323f5d9504..7913dd8c00583f3f5cf3cc1952e968132102fcf3 100644 (file)
@@ -196,7 +196,7 @@ do_kernel_checkout() {
                # If KMETA is defined, the branch must exist, but a machine branch
        # can be missing since it may be created later by the tools.
        if [ -n "${KMETA}" ]; then
-               git branch -a | grep -q ${KMETA}
+               git branch -a --no-color | grep -q ${KMETA}
                if [ $? -ne 0 ]; then
                        echo "ERROR. The branch '${KMETA}' is required and was not"
                        echo "found. Ensure that the SRC_URI points to a valid linux-yocto"
@@ -214,7 +214,7 @@ do_kernel_checkout() {
        fi
 
        # convert any remote branches to local tracking ones
-       for i in `git branch -a | grep remotes | grep -v HEAD`; do
+       for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
                b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
                git show-ref --quiet --verify -- "refs/heads/$b"
                if [ $? -ne 0 ]; then