Ticket #3649: patchversionsh.diff

File patchversionsh.diff, 2.1 KB (added by Carl Eugen Hoyos, 12 years ago)
  • version.sh

    diff --git a/version.sh b/version.sh
    index 92edcb9..139795f 100755
    a b  
    33# Usage: version.sh <ffmpeg-root-dir> <output-version.h> <extra-version>
    44
    55# check for git short hash
    6 if ! test "$revision"; then
    7     revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
    8 fi
     6test "$revision" ||
     7    revision=`cd "$1" && git describe --tags --match N 2> /dev/null`
    98
    109# Shallow Git clones (--depth) do not have the N tag:
    1110# use 'git-YYYY-MM-DD-hhhhhhh'.
    12 test "$revision" || revision=$(cd "$1" &&
    13   git log -1 --pretty=format:"git-%cd-%h" --date=short 2> /dev/null)
     11test "$revision" || revision=`cd "$1" &&
     12  git log -1 --pretty=format:"git-%cd-%h" --date=short 2> /dev/null`
    1413
    1514# Snapshots from gitweb are in a directory called ffmpeg-hhhhhhh or
    1615# ffmpeg-HEAD-hhhhhhh.
    1716if [ -z "$revision" ]; then
    18   srcdir=$(cd "$1" && pwd)
     17  srcdir=`cd "$1" && pwd`
    1918  case "$srcdir" in
    2019    */ffmpeg-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])
    2120      git_hash="${srcdir##*-}";;
    if [ -z "$revision" ]; then  
    2524fi
    2625
    2726# no revision number found
    28 test "$revision" || revision=$(cd "$1" && cat RELEASE 2> /dev/null)
     27test "$revision" || revision=`cd "$1" && cat RELEASE 2> /dev/null`
    2928
    3029# Append the Git hash if we have one
    3130test "$revision" && test "$git_hash" && revision="$revision-$git_hash"
    3231
    3332# releases extract the version number from the VERSION file
    34 version=$(cd "$1" && cat VERSION 2> /dev/null)
     33version=`cd "$1" && cat VERSION 2> /dev/null`
    3534test "$version" || version=$revision
    3635
    3736test -n "$3" && version=$version-$3
    if [ -z "$2" ]; then  
    4241fi
    4342
    4443NEW_REVISION="#define FFMPEG_VERSION \"$version\""
    45 OLD_REVISION=$(cat "$2" 2> /dev/null | head -3 | tail -1)
     44OLD_REVISION=`cat "$2" 2> /dev/null | head -3 | tail -1`
    4645
    4746# String used for preprocessor guard
    48 GUARD=$(echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//')
     47GUARD=`echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//'`
    4948
    5049# Update version header only on revision changes to avoid spurious rebuilds
    5150if test "$NEW_REVISION" != "$OLD_REVISION"; then