diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2008-11-04 03:05:46 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2008-11-04 03:05:46 +0000 |
commit | 4576a64e7228a25cfe2b8433795c3ca1801ec7a1 (patch) | |
tree | 621214349f6ea01e1feaebd729051081f49bc39e | |
parent | de6cddaea246241abe118df548aa3a728a2f43f0 (diff) | |
download | rockbox-4576a64e7228a25cfe2b8433795c3ca1801ec7a1.tar.gz rockbox-4576a64e7228a25cfe2b8433795c3ca1801ec7a1.zip |
svnversion.sh: extracts the revision number from git-svn repositories
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18998 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x | tools/svnversion.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/svnversion.sh b/tools/svnversion.sh index 1744e98c6e..8fe9804622 100755 --- a/tools/svnversion.sh +++ b/tools/svnversion.sh | |||
@@ -16,7 +16,25 @@ svnversion_safe() { | |||
16 | # LANG=C forces svnversion to not localize "exported". | 16 | # LANG=C forces svnversion to not localize "exported". |
17 | if OUTPUT=`LANG=C svnversion "$@"`; then | 17 | if OUTPUT=`LANG=C svnversion "$@"`; then |
18 | if [ "$OUTPUT" = "exported" ]; then | 18 | if [ "$OUTPUT" = "exported" ]; then |
19 | echo "unknown" | 19 | |
20 | # Not a SVN repository, maybe a git-svn one ? | ||
21 | if [ -z "$1" ]; then | ||
22 | GITDIR="./.git" | ||
23 | else | ||
24 | GITDIR="$1/.git" | ||
25 | fi | ||
26 | |||
27 | # First make sure it is a git repository | ||
28 | if [ -d "$GITDIR" ]; then | ||
29 | OUTPUT=`LANG=C git --git-dir="$GITDIR" svn info 2>/dev/null|grep '^Revision: '|cut -d\ -f2` | ||
30 | if [ -z "$OUTPUT" ]; then | ||
31 | echo "unknown" | ||
32 | else | ||
33 | echo "r$OUTPUT" | ||
34 | fi | ||
35 | else # not a git repository | ||
36 | echo "unknown" | ||
37 | fi | ||
20 | else | 38 | else |
21 | echo "r$OUTPUT" | 39 | echo "r$OUTPUT" |
22 | fi | 40 | fi |