From 1faaf91ebef9c6c18ef4a64df77634896d5dd5f6 Mon Sep 17 00:00:00 2001 From: sehraf Date: Fri, 14 Sep 2018 17:01:52 +0200 Subject: [PATCH] G10h4ck said that there are obsolete since #1336 and should not be used anymore. --- libretroshare/src/version_detail.bat | 48 ---------------------- libretroshare/src/version_detail.sh | 41 ------------------- retroshare-gui/src/version_detail.bat | 59 --------------------------- retroshare-gui/src/version_detail.sh | 43 ------------------- 4 files changed, 191 deletions(-) delete mode 100644 libretroshare/src/version_detail.bat delete mode 100755 libretroshare/src/version_detail.sh delete mode 100644 retroshare-gui/src/version_detail.bat delete mode 100755 retroshare-gui/src/version_detail.sh diff --git a/libretroshare/src/version_detail.bat b/libretroshare/src/version_detail.bat deleted file mode 100644 index ffb523a96..000000000 --- a/libretroshare/src/version_detail.bat +++ /dev/null @@ -1,48 +0,0 @@ -@echo off - -setlocal enabledelayedexpansion - -:: Search git in PATH -set GitPath= -for %%P in ("%PATH:;=" "%") do ( - if exist "%%~P.\git.exe" ( - set GitPath=%%~P - goto found_git - ) -) - -:found_git -if "%GitPath%"=="" ( - echo git not found in PATH. Version update cancelled. - endlocal - exit /B 0 -) - -echo Update version - -:: Retrieve git information -set RsHash= - -pushd "%~dp0" -for /f "tokens=1*" %%A in ('"git log --pretty=format:"%%H" --max-count=1"') do set RsHash=%%A -popd - -if "%RsHash%"=="" ( - echo Git hash not found. - endlocal - exit /B 1 -) - -:: Create file -set InFile=%~dp0retroshare\rsversion.in -set OutFile=%~dp0retroshare\rsversion.h -if exist "%OutFile%" del /Q "%OutFile%" - -for /f "tokens=* delims= " %%a in (%InFile%) do ( - set line=%%a - set line=!line:$REV$=%RsHash:~0,8%! - echo !line!>>"%OutFile%" -) - -endlocal -exit /B 0 diff --git a/libretroshare/src/version_detail.sh b/libretroshare/src/version_detail.sh deleted file mode 100755 index 3f83ff8f4..000000000 --- a/libretroshare/src/version_detail.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -#don't exit even if a command fails -set +e - -pushd $(dirname "$0") - -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)" -fi - -# if ( git log -n 1 | grep svn &> /dev/null); then -# #retrieve git svn information -# version="${version} svn : $(git log -n 1 | awk '/svn/ {print $2}' | head -1 | sed 's/.*@//')" -# elif ( git log -n 10 | grep svn &> /dev/null); then -# #retrieve git svn information -# version="${version} svn closest version : $(git log -n 10 | awk '/svn/ {print $2}' | head -1 | sed 's/.*@//')" -# fi - -# if ( svn info &> /dev/null); then -# version=$(svn info | awk '/^Revision:/ {print $NF}') -# fi - -if [[ ${version} != '' ]]; then - echo "Writing version to retroshare/rsversion.h : ${version}" - 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} - -popd - -echo "script version_detail.sh finished normally" -exit 0 diff --git a/retroshare-gui/src/version_detail.bat b/retroshare-gui/src/version_detail.bat deleted file mode 100644 index e413fc70e..000000000 --- a/retroshare-gui/src/version_detail.bat +++ /dev/null @@ -1,59 +0,0 @@ -@echo off - -setlocal enabledelayedexpansion - -:: Search git in PATH -set GitPath= -for %%P in ("%PATH:;=" "%") do ( - if exist "%%~P.\git.exe" ( - set GitPath=%%~P - goto found_git - ) -) - -:found_git -if "%GitPath%"=="" ( - echo git not found in PATH. Version update cancelled. - endlocal - exit /B 0 -) - -echo Update version - -:: Retrieve git information -set RsBranch= -set RsHash= - -pushd "%~dp0" -for /f "tokens=1*" %%A in ('"git log --pretty=format:"%%H" --max-count=1"') do set RsHash=%%A -for /f "tokens=*" %%A in ('git rev-parse --abbrev-ref HEAD') do set RsBranch=%%A -popd - -if "%RsBranch%"=="" ( - echo Git branch not found. - endlocal - exit /B 1 -) -if "%RsHash%"=="" ( - echo Git hash not found. - endlocal - exit /B 1 -) - -set RsDate=%date% %TIME% - -:: Create file -set InFile=%~dp0gui\help\version.html.in -set OutFile=%~dp0gui\help\version.html -if exist "%OutFile%" del /Q "%OutFile%" - -for /f "tokens=* delims= " %%a in (%InFile%) do ( - set line=%%a - set line=!line:$Hash$=%RsHash%! - set line=!line:$Branch$=%RsBranch%! - set line=!line:$Date$=%RsDate%! - echo !line!>>"%OutFile%" -) - -endlocal -exit /B 0 diff --git a/retroshare-gui/src/version_detail.sh b/retroshare-gui/src/version_detail.sh deleted file mode 100755 index 1d4c87008..000000000 --- a/retroshare-gui/src/version_detail.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -#check if we're on *nix system -#write the version.html file - -#don't exit even if a command fails -set +e - -pushd $(dirname "$0") - -OLDLANG=${LANG} - -export LANG=C - -SCRIPT_PATH=$(dirname "`readlink -f "${0}"`") - -if (ls &> /dev/null); then - 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 | 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)" >> ${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)" >> ${SCRIPT_PATH}/gui/help/version.html - fi - - if ( /usr/bin/svn info &> /dev/null); then - echo "Svn version : $(svn info | awk '/^Revision:/ {print $NF}')" >> ${SCRIPT_PATH}/gui/help/version.html - fi - 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} - -popd - -echo "version_detail.sh scripts finished" -exit 0