2006-04-24 17:11:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ -f ${1}/.version ]; then
|
2006-09-20 23:20:11 +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
|
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
|
|
|
|
|
|
|
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}
|
2006-04-24 17:11:45 +00:00
|
|
|
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
|
2006-04-24 17:11:45 +00:00
|
|
|
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
|
2006-04-24 17:11:45 +00:00
|
|
|
continue
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
|
|
|
if [ "${PART}" = "branches" ] ; then
|
2006-04-24 17:11:45 +00:00
|
|
|
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
|
2006-04-24 17:11:45 +00:00
|
|
|
continue
|
|
|
|
fi
|
2007-12-10 09:00:44 +00:00
|
|
|
|
|
|
|
if [ "${PART}" = "team" ] ; then
|
2006-04-24 17:11:45 +00:00
|
|
|
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
|
2008-08-05 15:30:23 +00:00
|
|
|
else
|
|
|
|
echo "UNKNOWN__and_probably_unsupported"
|
2006-04-24 17:11:45 +00:00
|
|
|
fi
|