mirror of
https://github.com/mpv-player/mpv
synced 2024-12-16 03:45:23 +00:00
46b218ca34
Change the "main" name from "mplayer2" to "mplayer". Note that upstream mplayer2 uses "MPlayer2", and mplayer uses "MPlayer", so it's unambiguous. The version.sh script used to put the latest tag into the version script. The intention was to add a new tag on each release, but this hasn't been done in over a year, making the tag absolutely pointless. Remove it. Now "git-SHORTHASH" is used. Remove the string "MPlayer & mplayer2 teams" after the copyright date, because that sounded silly.
25 lines
774 B
Bash
Executable File
25 lines
774 B
Bash
Executable File
#!/bin/sh
|
|
|
|
test "$1" && extra="-$1"
|
|
|
|
# Extract revision number from file used by daily tarball snapshots
|
|
# or from "git describe" output
|
|
git_revision=$(cat snapshot_version 2> /dev/null)
|
|
test $git_revision || test ! -d .git || git_revision=`git rev-parse --short HEAD`
|
|
git_revision=$(expr "$git_revision" : v*'\(.*\)')
|
|
test $git_revision || git_revision=UNKNOWN
|
|
|
|
# releases extract the version number from the VERSION file
|
|
version=$(cat VERSION 2> /dev/null)
|
|
test $version || version=git-$git_revision
|
|
|
|
NEW_REVISION="#define VERSION \"${version}${extra}\""
|
|
OLD_REVISION=$(head -n 1 version.h 2> /dev/null)
|
|
|
|
# Update version.h only on revision changes to avoid spurious rebuilds
|
|
if test "$NEW_REVISION" != "$OLD_REVISION"; then
|
|
cat <<EOF > version.h
|
|
$NEW_REVISION
|
|
EOF
|
|
fi
|