mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 01:49:35 -04:00
Make sure that version_detail.sh script always:
* Uses proper directory name for source files. This approach should be portable, I think. * Always uses LANG=C for obtaining data, because in non-US environments it will not capture branch name, for example.
This commit is contained in:
parent
e824a2faea
commit
8fe9e9e791
2 changed files with 25 additions and 9 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue