res_pjsip_session: Allow BYE to be sent on disconnected session.
[asterisk/asterisk.git] / menuselect / make_version
1 #!/bin/sh
2
3 if [ -f ${1}/.version ]; then
4         cat ${1}.version
5 elif [ -f ${1}/.svnrevision ]; then
6         echo SVN-`cat ${1}/.svnbranch`-r`cat ${1}/.svnrevision`
7 elif [ -d .svn ]; then
8     PARTS=`LANG=C svn info ${1} | grep URL | awk '{print $2;}' | sed -e 's:^.*/svn/menuselect/::' | sed -e 's:/: :g'`
9     BRANCH=0
10     TEAM=0
11     
12     REV=`svnversion -c ${1} | cut -d: -f2`
13     
14     if [ "${PARTS}" = "trunk" ]
15         then
16         echo SVN-'trunk'-r${REV}
17         exit 0
18     fi
19     
20     for PART in $PARTS
21       do
22       if [ ${BRANCH} != 0 ]
23           then
24           RESULT="${RESULT}-${PART}"
25           break
26       fi
27       
28       if [ ${TEAM} != 0 ]
29           then
30           RESULT="${RESULT}-${PART}"
31           continue
32       fi
33       
34       if [ "${PART}" = "branches" ]
35           then
36           BRANCH=1
37           RESULT="branch"
38           continue
39       fi
40       
41       if [ "${PART}" = "tags" ]
42           then
43           BRANCH=1
44           RESULT="tag"
45           continue
46       fi
47       
48       if [ "${PART}" = "team" ]
49           then
50           TEAM=1
51           continue
52       fi
53     done
54     
55     echo SVN-${RESULT##-}-r${REV}
56 fi