diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-10-31 21:52:48 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-10-31 21:52:48 +0000 |
commit | 308936cd356fa2c559fbc2b2e3273403437e5fe7 (patch) | |
tree | 6809ad71bcafa0e77ff1ca76f746f042a858341b /tools/version.sh | |
parent | 77b2d02296b3e549e6115d15f5a778b502dda94c (diff) | |
download | rockbox-308936cd356fa2c559fbc2b2e3273403437e5fe7.tar.gz rockbox-308936cd356fa2c559fbc2b2e3273403437e5fe7.zip |
fix make VERSION=x.y to work again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28427 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/version.sh')
-rwxr-xr-x | tools/version.sh | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/tools/version.sh b/tools/version.sh index 2e75004901..484a33189c 100755 --- a/tools/version.sh +++ b/tools/version.sh | |||
@@ -90,24 +90,27 @@ bzrversion() { | |||
90 | # | 90 | # |
91 | if [ -n "$1" ]; then TOP=$1; else TOP=..; fi | 91 | if [ -n "$1" ]; then TOP=$1; else TOP=..; fi |
92 | 92 | ||
93 | # If the VERSIONFILE exisits we use that | 93 | # setting VERSION var on commandline has precedence |
94 | VERSIONFILE=docs/VERSION | 94 | if [ -z $VERSION ]; then |
95 | if [ -r $TOP/$VERSIONFILE ]; then VER=`cat $TOP/$VERSIONFILE`; | 95 | # If the VERSIONFILE exisits we use that |
96 | else | 96 | VERSIONFILE=docs/VERSION |
97 | # Ok, we need to derive it from the Version Control system | 97 | if [ -r $TOP/$VERSIONFILE ]; then VER=`cat $TOP/$VERSIONFILE`; |
98 | if [ -d "$TOP/.git" ]; then | ||
99 | VER=`gitversion $TOP` | ||
100 | elif [ -d "$TOP/.bzr" ]; then | ||
101 | VER=`bzrversion $TOP` | ||
102 | else | 98 | else |
103 | VER=`svnversion_safe $TOP`; | 99 | # Ok, we need to derive it from the Version Control system |
104 | if [ "$VER" = "unknown" ]; then | 100 | if [ -d "$TOP/.git" ]; then |
105 | # try getting it from a subdir to test if perhaps they are symlinked | 101 | VER=`gitversion $TOP` |
106 | # from the root | 102 | elif [ -d "$TOP/.bzr" ]; then |
107 | VER=`svnversion_safe $TOP/tools`; | 103 | VER=`bzrversion $TOP` |
108 | fi | 104 | else |
105 | VER=`svnversion_safe $TOP`; | ||
106 | if [ "$VER" = "unknown" ]; then | ||
107 | # try getting it from a subdir to test if perhaps they are symlinked | ||
108 | # from the root | ||
109 | VER=`svnversion_safe $TOP/tools`; | ||
110 | fi | ||
111 | fi | ||
109 | fi | 112 | fi |
110 | fi | ||
111 | VERSION=$VER-`date -u +%y%m%d` | 113 | VERSION=$VER-`date -u +%y%m%d` |
114 | fi | ||
112 | echo $VERSION | 115 | echo $VERSION |
113 | 116 | ||