Revision 1f3229527e71d0b9946565e9e8e4eefd69464273 authored by Andreas Cadhalpun on 19 November 2016, 13:21:11 UTC, committed by Sean McGovern on 11 November 2017, 03:43:40 UTC
This fixes segmentation faults due to stack-overflow caused by too deep
recursion.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
(cherry picked from commit 0ccddbad200c1d9439c5a836501917d515cddf76)
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
1 parent f24056c
Raw File
version.sh
#!/bin/sh

# check for git short hash
revision=$(cd "$1" && git describe --always 2> /dev/null)

# no revision number found
test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)

# releases extract the version number from the VERSION file
version=$(cd "$1" && cat VERSION 2> /dev/null)
test "$version" || version=$revision

test -n "$3" && version=$version-$3

if [ -z "$2" ]; then
    echo "$version"
    exit
fi

NEW_REVISION="#define LIBAV_VERSION \"$version\""
OLD_REVISION=$(cat version.h 2> /dev/null)

# Update version.h only on revision changes to avoid spurious rebuilds
if test "$NEW_REVISION" != "$OLD_REVISION"; then
    echo "$NEW_REVISION" > "$2"
fi
back to top