1Upstream-Status: Pending
2
3When WORKDIR is included in some other git checkout, version.sh calls git rev-parse
4and it returns some description from that upper git checkout even when rfkill is
5being built from release tarball.
6
7When returned description doesn't match with expected v0.4, version.sh exits
8without creating version.c
9    # on git builds check that the version number above
10    # is correct...
11    [ "${descr%%-*}" = "v$VERSION" ] || exit 2
12
13and build fails a bit later:
14    | NOTE: make -j 32 -e MAKEFLAGS=
15    |  CC   rfkill.o
16    |  GEN  version.c
17    | make: *** [version.c] Error 2
18    | make: *** Waiting for unfinished jobs....
19    | ERROR: oe_runmake failed
20
21Don't try git rev-parse, if there isn't .git in ${S}.
22
23--- a/version.sh	2013-11-15 03:43:12.587744366 -0800
24+++ b/version.sh	2013-11-15 03:42:40.699743320 -0800
25@@ -12,7 +12,7 @@
26
27 if test "x$SUFFIX" != 'x'; then
28 	v="$VERSION$SUFFIX"
29-elif head=`git rev-parse --verify HEAD 2>/dev/null`; then
30+elif test -d .git && head=`git rev-parse --verify HEAD 2>/dev/null`; then
31 	git update-index --refresh --unmerged > /dev/null
32 	descr=$(git describe 2>/dev/null || echo "v$VERSION")
33
34