mirror of https://github.com/FFmpeg/FFmpeg.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
673 B
27 lines
673 B
19 years ago
|
#!/bin/sh
|
||
|
|
||
17 years ago
|
# check for git short hash
|
||
14 years ago
|
revision=$(cd "$1" && git describe --always 2> /dev/null)
|
||
17 years ago
|
|
||
16 years ago
|
# no revision number found
|
||
14 years ago
|
test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
|
||
17 years ago
|
|
||
16 years ago
|
# releases extract the version number from the VERSION file
|
||
15 years ago
|
version=$(cd "$1" && cat VERSION 2> /dev/null)
|
||
14 years ago
|
test "$version" || version=$revision
|
||
16 years ago
|
|
||
16 years ago
|
test -n "$3" && version=$version-$3
|
||
|
|
||
15 years ago
|
if [ -z "$2" ]; then
|
||
|
echo "$version"
|
||
|
exit
|
||
|
fi
|
||
|
|
||
14 years ago
|
NEW_REVISION="#define LIBAV_VERSION \"$version\""
|
||
8 years ago
|
OLD_REVISION=$(cat "$2" 2> /dev/null)
|
||
19 years ago
|
|
||
|
# Update version.h only on revision changes to avoid spurious rebuilds
|
||
|
if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
||
17 years ago
|
echo "$NEW_REVISION" > "$2"
|
||
19 years ago
|
fi
|