Merge pull request #205 from pztrn/master

Make sure that version_detail.sh script always do 2 things
This commit is contained in:
Cyril Soler 2016-06-05 13:17:30 -04:00
commit 456b57b5c9
2 changed files with 25 additions and 9 deletions

View File

@ -3,6 +3,12 @@
#don't exit even if a command fails
set +e
SCRIPT_PATH=$(dirname "`readlink -f "${0}"`")
OLDLANG=${LANG}
export LANG=C
if ( git log -n 1 &> /dev/null); then
#retrieve git information
version="$(git log --pretty=format:"%H" | head -1 | cut -c1-8)"
@ -22,7 +28,9 @@ fi
if [[ ${version} != '' ]]; then
echo "Writing version to retroshare/rsversion.h : ${version}"
sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${version}%" retroshare/rsversion.in >retroshare/rsversion.h
sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${version}%" ${SCRIPT_PATH}/retroshare/rsversion.in >${SCRIPT_PATH}/retroshare/rsversion.h
fi
export LANG=${OLDLANG}
echo "script version_detail.sh finished normally"
exit 0

View File

@ -5,26 +5,34 @@
#don't exit even if a command fails
set +e
OLDLANG=${LANG}
export LANG=C
SCRIPT_PATH=$(dirname "`readlink -f "${0}"`")
if (ls &> /dev/null); then
echo "Retroshare Gui version : " > gui/help/version.html
echo "Retroshare Gui version : " > ${SCRIPT_PATH}/gui/help/version.html
if ( /usr/bin/git log -n 1 &> /dev/null); then
#retrieve git information
echo "Git version : $(git status | grep branch | cut -c 3-) $(git log -n 1 | grep commit)" >> gui/help/version.html
echo "Git version : $(git status | grep branch | head -n 1 | cut -c 4-) $(git log -n 1 | grep commit)" >> ${SCRIPT_PATH}/gui/help/version.html
fi
if ( /usr/bin/git log -n 1 | grep svn &> /dev/null); then
#retrieve git svn information
echo "Svn version : $(git log -n 1 | awk '/svn/ {print $2}' | head -1)" >> gui/help/version.html
echo "Svn version : $(git log -n 1 | awk '/svn/ {print $2}' | head -1)" >> ${SCRIPT_PATH}/gui/help/version.html
elif ( /usr/bin/git log -n 10 | grep svn &> /dev/null); then
#retrieve git svn information
echo "Svn closest version : $(git log -n 10 | awk '/svn/ {print $2}' | head -1)" >> gui/help/version.html
echo "Svn closest version : $(git log -n 10 | awk '/svn/ {print $2}' | head -1)" >> ${SCRIPT_PATH}/gui/help/version.html
fi
if ( /usr/bin/svn info &> /dev/null); then
echo "Svn version : $(svn info | awk '/^Revision:/ {print $NF}')" >> gui/help/version.html
echo "Svn version : $(svn info | awk '/^Revision:/ {print $NF}')" >> ${SCRIPT_PATH}/gui/help/version.html
fi
date >> gui/help/version.html
echo "" >> gui/help/version.html
echo "" >> gui/help/version.html
date >> ${SCRIPT_PATH}/gui/help/version.html
echo "" >> ${SCRIPT_PATH}/gui/help/version.html
echo "" >> ${SCRIPT_PATH}/gui/help/version.html
fi
export LANG=${OLDLANG}
echo "version_detail.sh scripts finished"
exit 0