mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue