Merged revisions 7285,7299,7310,7329 via svnmerge from
[asterisk/asterisk.git] / build_tools / make_svn_branch_name
1 #!/bin/sh
2
3 PARTS=`LANG=C svn info | grep URL | awk '{print $2;}' | sed -e s:^.*/svn/asterisk/:: | sed -e 's:/: :'`
4 BRANCH=0
5 TEAM=0
6
7 REV=`svnversion -c . | cut -d: -f2`
8
9 if [ "${PARTS}" = "trunk" ]
10 then
11     echo 'trunk'-r${REV}
12     exit 0
13 fi
14
15 for PART in $PARTS
16 do
17   if [ ${BRANCH} != 0 ]
18   then
19       RESULT="${RESULT}-${PART}"
20       break
21   fi
22
23   if [ ${TEAM} != 0 ]
24   then
25       RESULT="${RESULT}-${PART}"
26       continue
27   fi
28
29   if [ "${PART}" = "branches" ]
30   then
31       BRANCH=1
32       RESULT="branch"
33       continue
34   fi
35
36   if [ "${PART}" = "tags" ]
37   then
38       BRANCH=1
39       RESULT="tag"
40       continue
41   fi
42
43   if [ "${PART}" = "team" ]
44   then
45       TEAM=1
46       continue
47   fi
48 done
49
50 echo ${RESULT}-r${REV}