buildsystem: support for older git versions

As older git versions don't support "git rev-list --count" run it with wc instead if needed
This commit is contained in:
Philipp Felix Hoefler 2014-01-29 16:26:56 +01:00
parent e91ea202cf
commit 31d513c50a

View File

@ -31,7 +31,10 @@ $SCRIPTS/build kmod:host
BUILD_DATE=`date +%Y%m%d%H%M%S`
if [ "$OPENELEC_VERSION" = devel -o "$OPENELEC_VERSION" = debug ]; then
GIT_BUILD=$(git rev-list --count HEAD)
if ! GIT_BUILD=$(git rev-list --count HEAD 2>/dev/null)
then
GIT_BUILD=$(git rev-list HEAD | wc -l)
fi
GIT_HASH=$(git rev-parse HEAD)
GIT_ABBREV=$(git log -1 --pretty=format:%h)
OPENELEC_VERSION=$OPENELEC_VERSION-$BUILD_DATE-r$GIT_BUILD-g$GIT_ABBREV