mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-12 19:18:44 +02:00
56e11d2305
* qatar/master: Drop git- prefix from version labels Use the contents of RELEASE as version fallback instead of 'UNKNOWN' path64/open64: filter out unsupported flags Add Release Notes sipr: Drop unused DSPContext sipr: include string.h for mem*() sipr: Use memmove() to copy overlapped buffers. h264: drop some ugly casts Conflicts: version.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
29 lines
722 B
Bash
Executable File
29 lines
722 B
Bash
Executable File
#!/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
|