Skip to content
Browse files

Switch version.sh to use git rather than svn

  • Loading branch information...
1 parent 71bf56a commit 11ee9c52ab2d639fa316abd2a2b90bb84b722974 @Beirdo Beirdo committed Dec 3, 2010
Showing with 11 additions and 12 deletions.
  1. +11 −12 mythtv/version.sh
View
23 mythtv/version.sh
@@ -1,12 +1,11 @@
#!/bin/sh
#
# small shell script to generate version.cpp
-# it expects two parameters
+# it expects one parameter
# first parameter is the root of the source directory
-# second parameter is the svn base folder (trunk, branches/release-0-21-fixes)
if test $# -ne 1; then
- echo "Usage: version.sh SVN_TREE_DIR"
+ echo "Usage: version.sh GIT_TREE_DIR"
exit 1
fi
@@ -18,21 +17,21 @@ else
exit 0
fi
-SVNTREEDIR=$1
-SVNREPOPATH="exported"
+GITTREEDIR=$1
+GITREPOPATH="exported"
-SOURCE_VERSION=$(svnversion ${SVNTREEDIR} 2>/dev/null || echo Unknown)
+cd ${GITTREEDIR}
+
+SOURCE_VERSION=$(git describe --dirty || echo Unknown)
case "${SOURCE_VERSION}" in
exported|Unknown)
- if test -e $SVNTREEDIR/VERSION ; then
- . $SVNTREEDIR/VERSION
+ if test -e $GITTREEDIR/VERSION ; then
+ . $GITTREEDIR/VERSION
fi
;;
*)
- SVNREPOPATH=$(echo "$$URL$$" | sed -e 's,.*/svn/,,' \
- -e 's,/mythtv/version\.sh.*,,' \
- -e 's,/version\.sh.*,,')
+ BRANCH=$(git branch | sed -e '/^[^\*]/d' -e 's/^\* //' -e 's/(no branch)/exported/')
;;
esac
@@ -41,7 +40,7 @@ cat > .vers.new <<EOF
#include "mythversion.h"
const MPUBLIC char *myth_source_version = "${SOURCE_VERSION}";
-const MPUBLIC char *myth_source_path = "${SVNREPOPATH}";
+const MPUBLIC char *myth_source_path = "${BRANCH}";
const MPUBLIC char *myth_binary_version = MYTH_BINARY_VERSION;
EOF

0 comments on commit 11ee9c5

Please sign in to comment.
Something went wrong with that request. Please try again.