2006-04-24 17:11:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ -f ${1}/.version ]; then
|
2009-03-12 01:33:04 +00:00
|
|
|
cat ${1}/.version
|
2006-04-24 17:11:45 +00:00
|
|
|
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'`
|
2006-04-24 17:11:45 +00:00
|
|
|
BRANCH=0
|
|
|
|
TEAM=0
|
2007-02-21 14:07:43 +00:00
|
|
|
TAG=0
|
2012-06-06 17:22:11 +00:00
|
|
|
FEATURE=0
|
2007-12-10 09:00:44 +00:00
|
|
|
|
2006-04-24 17:11:45 +00:00
|
|
|
REV=`svnversion -c ${1} | cut -d: -f2`
|
2007-05-22 20:26:35 +00:00
|
|
|
|
2009-03-12 01:00:29 +00:00
|
|
|
INTEGRATED=`LANG=C svn pg automerge-propname ${1}`
|
|
|
|
if [ -z "${INTEGRATED}" ] ; then
|
2009-03-12 01:33:04 +00:00
|
|
|
INTEGRATED=svnmerge-integrated
|
2009-03-12 01:00:29 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
BASE=`LANG=C svn pg ${INTEGRATED} ${1} | cut -d: -f1`
|
2007-12-10 09:00:44 +00:00
|
|
|
|
|
|
|
if [ "${PARTS}" = "trunk" ] ; then
|
2009-03-12 01:33:04 +00:00
|
|
|
echo SVN-trunk-r${REV}
|
|
|
|
exit 0
|
2006-04-24 17:11:45 +00:00
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
|
|
|
for PART in $PARTS ; do
|
2009-03-12 01:33:04 +00:00
|
|
|
if [ ${TAG} != 0 ] ; then
|
|
|
|
if [ "${PART}" = "autotag_for_be" ] ; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "${PART}" = "autotag_for_sx00i" ] ; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
RESULT="${PART}"
|
|
|
|
break
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
2009-03-12 01:33:04 +00:00
|
|
|
if [ ${BRANCH} != 0 ] ; then
|
|
|
|
if [ -z "${RESULT}" ] ; then
|
|
|
|
RESULT="${PART}"
|
|
|
|
else
|
|
|
|
RESULT="${RESULT}-${PART}"
|
|
|
|
fi
|
2012-06-06 17:22:11 +00:00
|
|
|
if [ ${FEATURE} != 0 ] ; then
|
|
|
|
RESULT="${RESULT}-${FEATURE_NAME}"
|
|
|
|
fi
|
2009-03-12 01:33:04 +00:00
|
|
|
break
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
2009-03-12 01:33:04 +00:00
|
|
|
if [ ${TEAM} != 0 ] ; then
|
|
|
|
if [ -z "${RESULT}" ] ; then
|
|
|
|
RESULT="${PART}"
|
|
|
|
else
|
|
|
|
RESULT="${RESULT}-${PART}"
|
|
|
|
fi
|
|
|
|
continue
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
2012-06-06 17:22:11 +00:00
|
|
|
if [ "${PART}" = "certified" ] ; then
|
|
|
|
FEATURE=1
|
|
|
|
FEATURE_NAME="cert"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2009-03-12 01:33:04 +00:00
|
|
|
if [ "${PART}" = "branches" ] ; then
|
|
|
|
BRANCH=1
|
|
|
|
RESULT="branch"
|
|
|
|
continue
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
2009-03-12 01:33:04 +00:00
|
|
|
if [ "${PART}" = "tags" ] ; then
|
|
|
|
TAG=1
|
|
|
|
continue
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
2009-03-12 01:33:04 +00:00
|
|
|
if [ "${PART}" = "team" ] ; then
|
|
|
|
TEAM=1
|
|
|
|
continue
|
|
|
|
fi
|
2006-04-24 17:11:45 +00:00
|
|
|
done
|
2007-12-10 09:00:44 +00:00
|
|
|
|
|
|
|
if [ ${TAG} != 0 ] ; then
|
2009-03-12 01:33:04 +00:00
|
|
|
echo ${RESULT}
|
2007-12-10 09:00:44 +00:00
|
|
|
else
|
2009-03-12 01:33:04 +00:00
|
|
|
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
|
2007-02-21 14:07:43 +00:00
|
|
|
fi
|
2008-08-05 15:30:23 +00:00
|
|
|
else
|
2009-03-12 01:33:04 +00:00
|
|
|
echo "UNKNOWN__and_probably_unsupported"
|
2006-04-24 17:11:45 +00:00
|
|
|
fi
|