Files
asterisk/build_tools/make_version
T

73 lines
1.3 KiB
Bash
Raw Normal View History

#!/bin/sh
if [ -f ${1}/.version ]; then
2006-09-20 23:20:11 +00:00
cat ${1}/.version
elif [ -d .svn ]; then
2007-12-17 07:25:35 +00:00
PARTS=`LANG=C svn info ${1} | ${GREP} URL | ${AWK} '{print $2;}' | sed -e 's:^.*/svn/asterisk/::' | sed -e 's:/: :g'`
BRANCH=0
TEAM=0
2007-02-21 14:07:43 +00:00
TAG=0
2007-12-10 09:00:44 +00:00
REV=`svnversion -c ${1} | cut -d: -f2`
2007-05-22 20:26:35 +00:00
BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
2007-12-10 09:00:44 +00:00
if [ "${PARTS}" = "trunk" ] ; then
2007-08-22 18:06:28 +00:00
echo SVN-trunk-r${REV}
exit 0
fi
2007-12-10 09:00:44 +00:00
for PART in $PARTS ; do
if [ ${TAG} != 0 ] ; then
2008-01-29 23:59:41 +00:00
if [ "${PART}" = "autotag_for_be" ] ; then
continue
fi
if [ "${PART}" = "autotag_for_sx00i" ] ; then
continue
fi
2007-02-21 14:07:43 +00:00
RESULT="${PART}"
break
fi
2007-12-10 09:00:44 +00:00
if [ ${BRANCH} != 0 ] ; then
if [ -z ${RESULT} ] ; then
2007-08-22 18:06:28 +00:00
RESULT="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
break
fi
2007-12-10 09:00:44 +00:00
if [ ${TEAM} != 0 ] ; then
if [ -z ${RESULT} ] ; then
2007-08-22 18:06:28 +00:00
RESULT="${PART}"
else
RESULT="${RESULT}-${PART}"
fi
continue
fi
2007-12-10 09:00:44 +00:00
if [ "${PART}" = "branches" ] ; then
BRANCH=1
RESULT="branch"
continue
fi
2007-12-10 09:00:44 +00:00
if [ "${PART}" = "tags" ] ; then
2007-02-21 14:07:43 +00:00
TAG=1
continue
fi
2007-12-10 09:00:44 +00:00
if [ "${PART}" = "team" ] ; then
TEAM=1
continue
fi
done
2007-12-10 09:00:44 +00:00
if [ ${TAG} != 0 ] ; then
2007-02-21 14:07:43 +00:00
echo ${RESULT}
2007-12-10 09:00:44 +00:00
else
2007-08-22 18:06:28 +00:00
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
2007-02-21 14:07:43 +00:00
fi
fi