scripts: fix getver git dir check
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 14 Feb 2015 20:48:37 +0000 (20:48 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 14 Feb 2015 20:48:37 +0000 (20:48 +0000)
commitfc4ca29984fa9d8a316b24dc2ad1ff189c44e1da
treefeafbffab708fc897d5e82a3cc327b0cc21b2788
parent80bdc13bfb458899f151f13fc5eed90f22302ccf
scripts: fix getver git dir check

Git internals are referenced by .git which isn't necessarily a
directory. It may also be a file that references the actual .git
directory using the gitdir directive.

If .git is assumed to be a directory the build will not be able to get
the correct version when openwrt is included as a git submodule because
when used as a submodule .git will actually be a file referencing to a
subdirectory in the parent's git dir.

When the correct version is not detected some image generation tools
will fail because the OpenWrt string will be 'OpenWrtunknown' which is
too long for some header formats.

Signed-off-by: Felix Kaechele <heffer@fedoraproject.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44452 3c298f89-4303-0410-b956-a3cf2f4a3e73
scripts/getver.sh