This fixes a crash when LOW_MEMORY is turned on. Two allocations of the ast_rtp struc...
[asterisk-bristuff.git] / build_tools / make_version
blobe55727f403eec3dca028a0629f4e87cfc953d593
1 #!/bin/sh
3 if [ -f ${1}/.version ]; then
4 cat ${1}/.version
5 elif [ -d .svn ]; then
6 PARTS=`LANG=C svn info ${1} | ${GREP} URL | ${AWK} '{print $2;}' | sed -e 's:^.*/svn/asterisk/::' | sed -e 's:/: :g'`
7 BRANCH=0
8 TEAM=0
9 TAG=0
11 REV=`svnversion -c ${1} | cut -d: -f2`
13 BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
15 if [ "${PARTS}" = "trunk" ]
16 then
17 echo SVN-trunk-r${REV}
18 exit 0
21 for PART in $PARTS
23 if [ ${TAG} != 0 ]
24 then
25 if [ "${PART}" = "autotag_for_be" ] ; then
26 continue
28 if [ "${PART}" = "autotag_for_sx00i" ] ; then
29 continue
31 RESULT="${PART}"
32 break
35 if [ ${BRANCH} != 0 ]
36 then
37 if [ -z ${RESULT} ]
38 then
39 RESULT="${PART}"
40 else
41 RESULT="${RESULT}-${PART}"
43 break
46 if [ ${TEAM} != 0 ]
47 then
48 if [ -z ${RESULT} ]
49 then
50 RESULT="${PART}"
51 else
52 RESULT="${RESULT}-${PART}"
54 continue
57 if [ "${PART}" = "branches" ]
58 then
59 BRANCH=1
60 RESULT="branch"
61 continue
64 if [ "${PART}" = "tags" ]
65 then
66 TAG=1
67 continue
70 if [ "${PART}" = "team" ]
71 then
72 TEAM=1
73 continue
75 done
77 if [ ${TAG} != 0 ]
78 then
79 echo ${RESULT}
80 else
81 echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}