mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
Merge pull request #205 from pztrn/master
Make sure that version_detail.sh script always do 2 things
This commit is contained in:
commit
456b57b5c9
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user