Skip to content

Commit

Permalink
Have version.sh check for version information in EXPORTED_VERSION
Browse files Browse the repository at this point in the history
(formerly GITHASH).

This gives us usable version information for source which has been
exported from git with git archive.
  • Loading branch information
stuartm committed Sep 2, 2013
1 parent c9b7516 commit cc037a8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mythtv/GITHASH export-subst
mythplugins/GITHASH export-subst
mythtv/EXPORTED_VERSION export-subst
mythplugins/EXPORTED_VERSION export-subst
1 change: 0 additions & 1 deletion mythplugins/GITHASH

This file was deleted.

2 changes: 2 additions & 0 deletions mythtv/EXPORTED_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SOURCE_VERSION="$Format:%h$"
BRANCH="$Format:%d$"
1 change: 0 additions & 1 deletion mythtv/GITHASH

This file was deleted.

8 changes: 6 additions & 2 deletions mythtv/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cc037a8

Please sign in to comment.