Skip to content

Commit

Permalink
change updateSVN to also support REVISION fixed file and git
Browse files Browse the repository at this point in the history
  • Loading branch information
s-u committed May 7, 2021
1 parent ef4db63 commit 6aec1e6
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions updateSVN
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@ fi

OWD=`pwd`
cd "$1"
SVN=svn
for paths in /usr/local/bin /opt/R/arm64/bin; do
if [ -e "$paths/svn" ]; then
SVN="$paths/svn"
fi
done
SVNREV=`$SVN info | sed -n 's/Revision:[ \t]*//p'`
if [ -z "$SVNREV" -a -f .svn/entries ]; then
SVNREV=`sed -n 's/.*revision="\(.*\)".*/\1/p' .svn/entries|head -n 1`
if [ -z "$SVNREV" ]; then
# SVN 1.4 changed the format - this is a pure guess!! (line 4 = revision)
SVNREV=`sed -n -e '4 p' .svn/entries`
fi

if [ -e .svn ]; then
SVN=svn
for paths in /usr/local/bin /opt/R/arm64/bin; do
if [ -e "$paths/svn" ]; then
SVN="$paths/svn"
fi
done
SVNREV=`$SVN info | sed -n 's/Revision:[ \t]*//p'`
if [ -z "$SVNREV" -a -f .svn/entries ]; then
SVNREV=`sed -n 's/.*revision="\(.*\)".*/\1/p' .svn/entries|head -n 1`
if [ -z "$SVNREV" ]; then
# SVN 1.4 changed the format - this is a pure guess!! (line 4 = revision)
SVNREV=`sed -n -e '4 p' .svn/entries`
fi
fi
elif [ -e REVISION ]; then
SVNREV=`cat REVISION`
elif [ -e .git ]; then
SVNREV=`git rev-parse --short HEAD`
fi
echo "Revision: $SVNREV"

Expand Down

0 comments on commit 6aec1e6

Please sign in to comment.