diff --git a/.gitattributes b/.gitattributes index 554f67a66a3..b35b0407cf7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -mythtv/GITHASH export-subst -mythplugins/GITHASH export-subst +mythtv/EXPORTED_VERSION export-subst +mythplugins/EXPORTED_VERSION export-subst diff --git a/mythplugins/GITHASH b/mythplugins/GITHASH deleted file mode 100644 index 6828f88dcb0..00000000000 --- a/mythplugins/GITHASH +++ /dev/null @@ -1 +0,0 @@ -$Format:%H$ diff --git a/mythtv/EXPORTED_VERSION b/mythtv/EXPORTED_VERSION new file mode 100644 index 00000000000..607a44ea3c2 --- /dev/null +++ b/mythtv/EXPORTED_VERSION @@ -0,0 +1,2 @@ +SOURCE_VERSION="$Format:%h$" +BRANCH="$Format:%d$" diff --git a/mythtv/GITHASH b/mythtv/GITHASH deleted file mode 100644 index fbe9a665422..00000000000 --- a/mythtv/GITHASH +++ /dev/null @@ -1 +0,0 @@ -$Format:%d$-Exported-$Format:%h$ diff --git a/mythtv/version.sh b/mythtv/version.sh index a8939c45d18..238fbffa1fe 100755 --- a/mythtv/version.sh +++ b/mythtv/version.sh @@ -27,12 +27,16 @@ SOURCE_VERSION=$(git describe --dirty || git describe || echo Unknown) case "${SOURCE_VERSION}" in exported|Unknown) - if test -e $GITTREEDIR/VERSION ; then + if ! grep -q Format $GITTREEDIR/EXPORTED_VERSION; then + . $GITTREEDIR/EXPORTED_VERSION + elif test -e $GITTREEDIR/VERSION ; then . $GITTREEDIR/VERSION fi ;; *) - BRANCH=$(git branch --no-color | sed -e '/^[^\*]/d' -e 's/^\* //' -e 's/(no branch)/exported/') + if [ -z "${BRANCH}" ]; then + BRANCH=$(git branch --no-color | sed -e '/^[^\*]/d' -e 's/^\* //' -e 's/(no branch)/exported/') + fi ;; esac