simplify/cleanup the scripts

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2007-12-10 09:00:44 +00:00
parent 9e4ebbee87
commit 19d616d4dc
2 changed files with 26 additions and 45 deletions

View File

@@ -7,71 +7,60 @@ elif [ -d .svn ]; then
BRANCH=0 BRANCH=0
TEAM=0 TEAM=0
TAG=0 TAG=0
REV=`svnversion -c ${1} | cut -d: -f2` REV=`svnversion -c ${1} | cut -d: -f2`
BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1` BASE=`LANG=C svn pg svnmerge-integrated ${1} | cut -d: -f1`
if [ "${PARTS}" = "trunk" ] if [ "${PARTS}" = "trunk" ] ; then
then
echo SVN-trunk-r${REV} echo SVN-trunk-r${REV}
exit 0 exit 0
fi fi
for PART in $PARTS for PART in $PARTS ; do
do if [ ${TAG} != 0 ] ; then
if [ ${TAG} != 0 ]
then
RESULT="${PART}" RESULT="${PART}"
break break
fi fi
if [ ${BRANCH} != 0 ] if [ ${BRANCH} != 0 ] ; then
then if [ -z ${RESULT} ] ; then
if [ -z ${RESULT} ]
then
RESULT="${PART}" RESULT="${PART}"
else else
RESULT="${RESULT}-${PART}" RESULT="${RESULT}-${PART}"
fi fi
break break
fi fi
if [ ${TEAM} != 0 ] if [ ${TEAM} != 0 ] ; then
then if [ -z ${RESULT} ] ; then
if [ -z ${RESULT} ]
then
RESULT="${PART}" RESULT="${PART}"
else else
RESULT="${RESULT}-${PART}" RESULT="${RESULT}-${PART}"
fi fi
continue continue
fi fi
if [ "${PART}" = "branches" ] if [ "${PART}" = "branches" ] ; then
then
BRANCH=1 BRANCH=1
RESULT="branch" RESULT="branch"
continue continue
fi fi
if [ "${PART}" = "tags" ] if [ "${PART}" = "tags" ] ; then
then
TAG=1 TAG=1
continue continue
fi fi
if [ "${PART}" = "team" ] if [ "${PART}" = "team" ] ; then
then
TEAM=1 TEAM=1
continue continue
fi fi
done done
if [ ${TAG} != 0 ] if [ ${TAG} != 0 ] ; then
then
echo ${RESULT} echo ${RESULT}
else else
echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}} echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}
fi fi
fi fi

View File

@@ -1,25 +1,17 @@
#!/bin/sh #!/bin/sh
if [ ! -f ../.flavor ]; then if [ ! -f ../.flavor ]; then
cat << END EXTRA=""
/*
* version.h
* Automatically generated
*/
#define ASTERISK_VERSION "${ASTERISKVERSION}"
#define ASTERISK_VERSION_NUM ${ASTERISKVERSIONNUM}
END
else else
aadkver=`cat ../.version` aadkver=`cat ../.version`
aadkflavor=`cat ../.flavor` aadkflavor=`cat ../.flavor`
cat << END EXTRA=" (${aadkflavor} ${aadkver})"
fi
cat << END
/* /*
* version.h * version.h
* Automatically generated * Automatically generated
*/ */
#define ASTERISK_VERSION "${ASTERISKVERSION} (${aadkflavor} ${aadkver})" #define ASTERISK_VERSION "${ASTERISKVERSION}${EXTRA}"
#define ASTERISK_VERSION_NUM ${ASTERISKVERSIONNUM} #define ASTERISK_VERSION_NUM ${ASTERISKVERSIONNUM}
END END
fi