Revision 7ab0b6b7eda60e235b7db07a6895fa8bdade01c8 authored by Laurent Aimar on 08 October 2011, 23:54:41 UTC, committed by Michael Niedermayer on 04 November 2011, 00:01:04 UTC
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6d45702f7f257c1cfcd3ce3287bf258854528a4a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
1 parent b832e53
Raw File
version.sh
#!/bin/sh

# check for git short hash
if ! test "$revision"; then
    revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
fi

# 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 FFMPEG_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