Skip to content

Commit 6aec1e6

Browse files
committed
change updateSVN to also support REVISION fixed file and git
1 parent ef4db63 commit 6aec1e6

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

updateSVN

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,26 @@ fi
99

1010
OWD=`pwd`
1111
cd "$1"
12-
SVN=svn
13-
for paths in /usr/local/bin /opt/R/arm64/bin; do
14-
if [ -e "$paths/svn" ]; then
15-
SVN="$paths/svn"
16-
fi
17-
done
18-
SVNREV=`$SVN info | sed -n 's/Revision:[ \t]*//p'`
19-
if [ -z "$SVNREV" -a -f .svn/entries ]; then
20-
SVNREV=`sed -n 's/.*revision="\(.*\)".*/\1/p' .svn/entries|head -n 1`
21-
if [ -z "$SVNREV" ]; then
22-
# SVN 1.4 changed the format - this is a pure guess!! (line 4 = revision)
23-
SVNREV=`sed -n -e '4 p' .svn/entries`
24-
fi
12+
13+
if [ -e .svn ]; then
14+
SVN=svn
15+
for paths in /usr/local/bin /opt/R/arm64/bin; do
16+
if [ -e "$paths/svn" ]; then
17+
SVN="$paths/svn"
18+
fi
19+
done
20+
SVNREV=`$SVN info | sed -n 's/Revision:[ \t]*//p'`
21+
if [ -z "$SVNREV" -a -f .svn/entries ]; then
22+
SVNREV=`sed -n 's/.*revision="\(.*\)".*/\1/p' .svn/entries|head -n 1`
23+
if [ -z "$SVNREV" ]; then
24+
# SVN 1.4 changed the format - this is a pure guess!! (line 4 = revision)
25+
SVNREV=`sed -n -e '4 p' .svn/entries`
26+
fi
27+
fi
28+
elif [ -e REVISION ]; then
29+
SVNREV=`cat REVISION`
30+
elif [ -e .git ]; then
31+
SVNREV=`git rev-parse --short HEAD`
2532
fi
2633
echo "Revision: $SVNREV"
2734

0 commit comments

Comments
 (0)