mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
get tag from git
This commit is contained in:
parent
fb8ffc9d96
commit
6b6b880bf0
@ -3,5 +3,5 @@
|
||||
|
||||
namespace Revision
|
||||
{
|
||||
unsigned get() { return SVN_REVISION; }
|
||||
unsigned get() { return REVISION; }
|
||||
}
|
||||
|
@ -1,14 +1,18 @@
|
||||
#!/bin/bash
|
||||
mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/src
|
||||
echo "#ifndef SVN_REVISION" > ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
echo -n "#define SVN_REVISION " >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
echo "#ifndef REVISION" > ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
echo -n "#define REVISION " >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
|
||||
cd ${CMAKE_CURRENT_SOURCE_DIR};
|
||||
|
||||
echo && (LC_ALL=C svn info ${PROJECT_SOURCE_DIR}/ 2>/dev/null || echo Revision 1) | grep Revision | cut -d " " -f 2 >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h;
|
||||
|
||||
echo -n "#define SVN_PATH " >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
SVN_PATH="$( (LC_ALL=C svn info ${PROJECT_SOURCE_DIR}/ 2>/dev/null || echo URL: unknown) | grep URL | cut -d ' ' -f 2 | sed 's/https:\/\/███████████.yandex-team.ru\/conv\///g')"
|
||||
echo '"'$SVN_PATH'"' >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h;
|
||||
git rev-parse --is-inside-work-tree &> /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
# GIT
|
||||
( git describe --tags || echo 1 ) | cut -d "-" -f 1 >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h;
|
||||
else
|
||||
#SVN
|
||||
echo && (LC_ALL=C svn info ${PROJECT_SOURCE_DIR}/ 2>/dev/null || echo Revision 1) | grep Revision | cut -d " " -f 2 >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h;
|
||||
fi
|
||||
|
||||
echo "#endif" >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
|
Loading…
Reference in New Issue
Block a user