Add several busy detection related defines to menuselect.
[asterisk/asterisk.git] / build_tools / make_version
1 #!/bin/sh
2
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
10
11     REV=`svnversion -c ${1} | cut -d: -f2`
12
13     BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
14
15     if [ "${PARTS}" = "trunk" ] ; then
16         echo SVN-trunk-r${REV}
17         exit 0
18     fi
19
20     for PART in $PARTS ; do
21       if [ ${TAG} != 0 ] ; then
22           RESULT="${PART}"
23           break
24       fi
25
26       if [ ${BRANCH} != 0 ] ; then
27           if [ -z ${RESULT} ] ; then
28             RESULT="${PART}"
29           else
30             RESULT="${RESULT}-${PART}"
31           fi
32           break
33       fi
34
35       if [ ${TEAM} != 0 ] ; then
36           if [ -z ${RESULT} ] ; then
37             RESULT="${PART}"
38           else
39             RESULT="${RESULT}-${PART}"
40           fi
41           continue
42       fi
43
44       if [ "${PART}" = "branches" ] ; then
45           BRANCH=1
46           RESULT="branch"
47           continue
48       fi
49
50       if [ "${PART}" = "tags" ] ; then
51           TAG=1
52           continue
53       fi
54
55       if [ "${PART}" = "team" ] ; then
56           TEAM=1
57           continue
58       fi
59     done
60
61     if [ ${TAG} != 0 ] ; then
62         echo ${RESULT}
63     else
64         echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
65     fi
66 fi