forked from len0rd/rockbox
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
This commit is contained in:
parent
de6cddaea2
commit
4576a64e72
1 changed files with 19 additions and 1 deletions
|
|
@ -16,7 +16,25 @@ svnversion_safe() {
|
|||
# LANG=C forces svnversion to not localize "exported".
|
||||
if OUTPUT=`LANG=C svnversion "$@"`; then
|
||||
if [ "$OUTPUT" = "exported" ]; then
|
||||
echo "unknown"
|
||||
|
||||
# Not a SVN repository, maybe a git-svn one ?
|
||||
if [ -z "$1" ]; then
|
||||
GITDIR="./.git"
|
||||
else
|
||||
GITDIR="$1/.git"
|
||||
fi
|
||||
|
||||
# First make sure it is a git repository
|
||||
if [ -d "$GITDIR" ]; then
|
||||
OUTPUT=`LANG=C git --git-dir="$GITDIR" svn info 2>/dev/null|grep '^Revision: '|cut -d\ -f2`
|
||||
if [ -z "$OUTPUT" ]; then
|
||||
echo "unknown"
|
||||
else
|
||||
echo "r$OUTPUT"
|
||||
fi
|
||||
else # not a git repository
|
||||
echo "unknown"
|
||||
fi
|
||||
else
|
||||
echo "r$OUTPUT"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue