mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
Merge pull request #1340 from sehraf/pr_remove-obsolete-version-scripts
remove obsolete version scripts
This commit is contained in:
commit
eece958aa0
4 changed files with 0 additions and 191 deletions
|
@ -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
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue