Changeset 2170
- Timestamp:
- 11/15/11 08:05:58 (18 months ago)
- Files:
-
- 1 modified
-
trunk/libelftc/make-toolchain-version (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libelftc/make-toolchain-version
r2065 r2170 56 56 [ -n "${top}" ] || usage 57 57 58 # Try to determine the tree version.58 # Try to determine the in-tree revision number. 59 59 # 60 # - If using SVN, use the `svninfo' tool. 61 # - If using CVS, use the string `unknown'. 62 # - Otherwise use `git --describe'. 60 # This script attempts to handle the case where our sources have been 61 # incorporated into an operating system's base sources. 62 # 63 # - If SVN is detected, we use the `svninfo' tool to determine the 64 # in-tree revision number. 65 # - If CVS is detected, we use the string `unknown'. 66 # - Otherwise, we use `git --describe'. 63 67 64 68 curdir=`pwd` 65 69 cd ${top} || usage "ERROR: Cannot change directory to \"${top}\"." 66 70 67 versionstring="" 68 if [ -d .svn ]; then 69 versionstring="svn:"$(svnversion) 70 elif [ -d CVS ]; then 71 versionstring="cvs:unknown" 72 else # Try Git 73 versionstring="git:"$(git describe --all --dirty --long) 71 if [ -d .svn ]; then # FreeBSD and SF.Net sources. 72 versionstring=" svn:"$(svnversion) 73 elif [ -d CVS ]; then # NetBSD. 74 versionstring=" cvs:unknown" 75 else # DragonFlyBSD. 76 versionstring=" git:"$(git describe --all --dirty --long 2> /dev/null) 74 77 75 if [ ${?} -ne 0 ]; then 76 usage "Cannot determine tree version." 78 # Cannot determine an in-tree version number. 79 if [ $? -ne 0 ]; then 80 versionstring="" 77 81 fi 78 82 fi … … 95 99 elftc_version(void) 96 100 { 97 return "${elftcname} ${branch} ${buildhost} ${versionstring}";101 return "${elftcname} ${branch} ${buildhost}${versionstring}"; 98 102 } 99 103 EOF