diff options
| -rw-r--r-- | meta/classes/kernel-yocto.bbclass | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 0ac1572471..9209f423cf 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
| @@ -200,11 +200,20 @@ do_kernel_checkout() { | |||
| 200 | fi | 200 | fi |
| 201 | # end debare | 201 | # end debare |
| 202 | 202 | ||
| 203 | # convert any remote branches to local tracking ones | ||
| 204 | for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do | ||
| 205 | b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; | ||
| 206 | git show-ref --quiet --verify -- "refs/heads/$b" | ||
| 207 | if [ $? -ne 0 ]; then | ||
| 208 | git branch $b $i > /dev/null | ||
| 209 | fi | ||
| 210 | done | ||
| 211 | |||
| 203 | # If KMETA is defined, the branch must exist, but a machine branch | 212 | # If KMETA is defined, the branch must exist, but a machine branch |
| 204 | # can be missing since it may be created later by the tools. | 213 | # can be missing since it may be created later by the tools. |
| 205 | if [ -n "${KMETA}" ]; then | 214 | if [ -n "${KMETA}" ]; then |
| 206 | git branch -a --no-color | grep -q ${KMETA} | 215 | git show-ref --quiet --verify -- "refs/heads/${KMETA}" |
| 207 | if [ $? -ne 0 ]; then | 216 | if [ $? -eq 1 ]; then |
| 208 | echo "ERROR. The branch '${KMETA}' is required and was not" | 217 | echo "ERROR. The branch '${KMETA}' is required and was not" |
| 209 | echo "found. Ensure that the SRC_URI points to a valid linux-yocto" | 218 | echo "found. Ensure that the SRC_URI points to a valid linux-yocto" |
| 210 | echo "kernel repository" | 219 | echo "kernel repository" |
| @@ -214,15 +223,6 @@ do_kernel_checkout() { | |||
| 214 | 223 | ||
| 215 | machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" | 224 | machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" |
| 216 | 225 | ||
| 217 | # convert any remote branches to local tracking ones | ||
| 218 | for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do | ||
| 219 | b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; | ||
| 220 | git show-ref --quiet --verify -- "refs/heads/$b" | ||
| 221 | if [ $? -ne 0 ]; then | ||
| 222 | git branch $b $i > /dev/null | ||
| 223 | fi | ||
| 224 | done | ||
| 225 | |||
| 226 | # Create a working tree copy of the kernel by checking out a branch | 226 | # Create a working tree copy of the kernel by checking out a branch |
| 227 | git show-ref --quiet --verify -- "refs/heads/${machine_branch}" | 227 | git show-ref --quiet --verify -- "refs/heads/${machine_branch}" |
| 228 | if [ $? -eq 0 ]; then | 228 | if [ $? -eq 0 ]; then |
