2018-05-28 06:34:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-01-18 02:28:58 +00:00
|
|
|
GIT_VER=$(git log|grep ^commit|wc -l|sed -e "s/^ *//")
|
|
|
|
MD5=$(git log|head -1|awk '{printf $2}')
|
2019-08-01 05:01:54 +00:00
|
|
|
MAJOR=1
|
|
|
|
MINOR=0
|
|
|
|
PATCH=0
|
2019-08-01 05:40:53 +00:00
|
|
|
PRE_RELEASE_STRING="beta5"
|
2018-05-28 06:34:47 +00:00
|
|
|
TMP_FILE=/tmp/version
|
2019-08-01 05:01:54 +00:00
|
|
|
echo "#define MAJOR ${MAJOR}" > ${TMP_FILE}
|
|
|
|
echo "#define MINOR ${MINOR}" >> ${TMP_FILE}
|
|
|
|
echo "#define PATCH ${PATCH}" >> ${TMP_FILE}
|
|
|
|
echo "#define PRE_RELEASE_STRING \"${PRE_RELEASE_STRING}\"" >> ${TMP_FILE}
|
|
|
|
echo "#define VERSION \"${MAJOR}.${MINOR}.${PATCH}.${PRE_RELEASE_STRING}.$GIT_VER\"" >> ${TMP_FILE}
|
2018-10-02 12:02:43 +00:00
|
|
|
echo "#define VERSION_MD5 \"$MD5\"" >> ${TMP_FILE}
|
2018-05-28 06:34:47 +00:00
|
|
|
if [ ! -f $1 ];then
|
2018-10-02 12:02:43 +00:00
|
|
|
mv -f ${TMP_FILE} $1
|
2018-05-28 06:34:47 +00:00
|
|
|
else
|
2018-10-02 12:02:43 +00:00
|
|
|
diff ${TMP_FILE} $1
|
2018-05-28 06:34:47 +00:00
|
|
|
if [ $? -eq 1 ];then
|
2018-10-02 12:02:43 +00:00
|
|
|
mv -f ${TMP_FILE} $1
|
2018-10-02 11:44:33 +00:00
|
|
|
else
|
2018-10-02 12:02:43 +00:00
|
|
|
rm -f ${TMP_FILE}
|
2018-05-28 06:34:47 +00:00
|
|
|
fi
|
2018-05-30 07:55:27 +00:00
|
|
|
fi
|