Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5f9f5be6
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5f9f5be6
编写于
3月 27, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: enterprise version displays the associated community version gitinfo
上级
b1b56b16
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
28 deletion
+54
-28
cmake/cmake.version
cmake/cmake.version
+18
-1
include/util/version.h
include/util/version.h
+1
-0
source/dnode/mgmt/exe/dmMain.c
source/dnode/mgmt/exe/dmMain.c
+13
-9
source/util/src/version.c.in
source/util/src/version.c.in
+1
-0
tools/shell/src/shellArguments.c
tools/shell/src/shellArguments.c
+21
-18
未找到文件。
cmake/cmake.version
浏览文件 @
5f9f5be6
...
...
@@ -16,7 +16,7 @@ find_program(HAVE_GIT NAMES git)
IF (DEFINED GITINFO)
SET(TD_VER_GIT ${GITINFO})
ELSEIF (HAVE_GIT)
execute_process(COMMAND git log -1 --format=%H WORKING_DIRECTORY ${
CMAKE_CURRENT_SOURCE
_DIR} OUTPUT_VARIABLE GIT_COMMITID)
execute_process(COMMAND git log -1 --format=%H WORKING_DIRECTORY ${
TD_COMMUNITY
_DIR} OUTPUT_VARIABLE GIT_COMMITID)
#message(STATUS "git log result:${GIT_COMMITID}")
IF (GIT_COMMITID)
string (REGEX REPLACE "[\n\t\r]" "" GIT_COMMITID ${GIT_COMMITID})
...
...
@@ -30,6 +30,23 @@ ELSE ()
SET(TD_VER_GIT "no git commit id")
ENDIF ()
IF (DEFINED GITINFOI)
SET(TD_VER_GIT_INTERNAL ${GITINFOI})
ELSEIF (HAVE_GIT)
execute_process(COMMAND git log -1 --format=%H WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMITID)
message(STATUS "git log result:${GIT_COMMITID}")
IF (GIT_COMMITID)
string (REGEX REPLACE "[\n\t\r]" "" GIT_COMMITID ${GIT_COMMITID})
SET(TD_VER_GIT_INTERNAL ${GIT_COMMITID})
ELSE ()
message(STATUS "not a git repository")
SET(TD_VER_GIT "no git commit id")
ENDIF ()
ELSE ()
message(STATUS "no git cmd")
SET(TD_VER_GIT_INTERNAL "no git commit id")
ENDIF ()
IF (DEFINED VERDATE)
SET(TD_VER_DATE ${VERDATE})
ELSE ()
...
...
include/util/version.h
浏览文件 @
5f9f5be6
...
...
@@ -23,6 +23,7 @@ extern "C" {
extern
char
version
[];
extern
char
compatible_version
[];
extern
char
gitinfo
[];
extern
char
gitinfoOfInternal
[];
extern
char
buildinfo
[];
#ifdef __cplusplus
...
...
source/dnode/mgmt/exe/dmMain.c
浏览文件 @
5f9f5be6
...
...
@@ -18,6 +18,7 @@
#include "mnode.h"
#include "tconfig.h"
#include "tglobal.h"
#include "version.h"
// clang-format off
#define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'."
...
...
@@ -76,28 +77,28 @@ void dmLogCrash(int signum, void *sigInfo, void *context) {
taosIgnSignal
(
SIGINT
);
taosIgnSignal
(
SIGBREAK
);
#ifndef WINDOWS
#ifndef WINDOWS
taosIgnSignal
(
SIGBUS
);
#endif
taosIgnSignal
(
SIGABRT
);
taosIgnSignal
(
SIGFPE
);
taosIgnSignal
(
SIGSEGV
);
char
*
pMsg
=
NULL
;
char
*
pMsg
=
NULL
;
const
char
*
flags
=
"UTL FATAL "
;
ELogLevel
level
=
DEBUG_FATAL
;
int32_t
dflag
=
255
;
int64_t
msgLen
=
-
1
;
int64_t
msgLen
=
-
1
;
if
(
tsEnableCrashReport
)
{
if
(
taosGenCrashJsonMsg
(
signum
,
&
pMsg
,
dmGetClusterId
(),
global
.
startTime
))
{
taosPrintLog
(
flags
,
level
,
dflag
,
"failed to generate crash json msg"
);
goto
_return
;
}
else
{
msgLen
=
strlen
(
pMsg
);
msgLen
=
strlen
(
pMsg
);
}
}
_return:
taosLogCrashInfo
(
"taosd"
,
pMsg
,
msgLen
,
signum
,
sigInfo
);
...
...
@@ -123,7 +124,7 @@ static void dmSetSignalHandle() {
#ifndef WINDOWS
taosSetSignal
(
SIGBUS
,
dmLogCrash
);
#endif
#endif
taosSetSignal
(
SIGABRT
,
dmLogCrash
);
taosSetSignal
(
SIGFPE
,
dmLogCrash
);
taosSetSignal
(
SIGSEGV
,
dmLogCrash
);
...
...
@@ -134,7 +135,7 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) {
int32_t
cmdEnvIndex
=
0
;
if
(
argc
<
2
)
return
0
;
global
.
envCmd
=
taosMemoryMalloc
((
argc
-
1
)
*
sizeof
(
char
*
));
memset
(
global
.
envCmd
,
0
,
(
argc
-
1
)
*
sizeof
(
char
*
));
for
(
int32_t
i
=
1
;
i
<
argc
;
++
i
)
{
...
...
@@ -203,6 +204,9 @@ static void dmPrintVersion() {
#endif
printf
(
"%s version: %s compatible_version: %s
\n
"
,
releaseName
,
version
,
compatible_version
);
printf
(
"gitinfo: %s
\n
"
,
gitinfo
);
#ifdef TD_ENTERPRISE
printf
(
"gitinfoOfInternal: %s
\n
"
,
gitinfoOfInternal
);
#endif
printf
(
"buildInfo: %s
\n
"
,
buildinfo
);
}
...
...
@@ -284,7 +288,7 @@ int mainWindows(int argc, char **argv) {
printf
(
"failed to init memory dbg, error:%s
\n
"
,
tstrerror
(
code
));
return
code
;
}
tsAsyncLog
=
false
;
tsAsyncLog
=
false
;
printf
(
"memory dbg enabled
\n
"
);
}
#endif
...
...
source/util/src/version.c.in
浏览文件 @
5f9f5be6
char version[64] = "${TD_VER_NUMBER}";
char compatible_version[12] = "${TD_VER_COMPATIBLE}";
char gitinfo[48] = "${TD_VER_GIT}";
char gitinfoOfInternal[48] = "${TD_VER_GIT_INTERNAL}";
char buildinfo[64] = "Built at ${TD_VER_DATE}";
void libtaos_${TD_LIB_VER_NUMBER}_${TD_VER_OSTYPE}_${TD_VER_CPUTYPE}_${TD_VER_VERTYPE}() {};
tools/shell/src/shellArguments.c
浏览文件 @
5f9f5be6
...
...
@@ -18,17 +18,18 @@
#endif
#include "shellInt.h"
#include "version.h"
#ifndef CUS_NAME
char
cusName
[]
=
"TDengine"
;
char
cusName
[]
=
"TDengine"
;
#endif
#ifndef CUS_PROMPT
char
cusPrompt
[]
=
"taos"
;
char
cusPrompt
[]
=
"taos"
;
#endif
#ifndef CUS_EMAIL
char
cusEmail
[]
=
"<support@taosdata.com>"
;
char
cusEmail
[]
=
"<support@taosdata.com>"
;
#endif
#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
...
...
@@ -58,9 +59,9 @@
#define SHELL_VERSION "Print program version."
#ifdef WEBSOCKET
#define SHELL_DSN
"The dsn to use when connecting to cloud server."
#define SHELL_REST
"Use restful mode when connecting."
#define SHELL_TIMEOUT
"Set the timeout for websocket query in seconds, default is 30."
#define SHELL_DSN "The dsn to use when connecting to cloud server."
#define SHELL_REST "Use restful mode when connecting."
#define SHELL_TIMEOUT "Set the timeout for websocket query in seconds, default is 30."
#endif
static
int32_t
shellParseSingleOpt
(
int32_t
key
,
char
*
arg
);
...
...
@@ -145,7 +146,7 @@ static void shellParseArgsUseArgp(int argc, char *argv[]) {
#endif
#ifndef ARGP_ERR_UNKNOWN
#define ARGP_ERR_UNKNOWN E2BIG
#define ARGP_ERR_UNKNOWN E2BIG
#endif
static
int32_t
shellParseSingleOpt
(
int32_t
key
,
char
*
arg
)
{
...
...
@@ -246,8 +247,8 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
SShellArgs
*
pArgs
=
&
shell
.
args
;
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
||
strcmp
(
argv
[
i
],
"--usage"
)
==
0
||
strcmp
(
argv
[
i
],
"-?"
)
==
0
||
strcmp
(
argv
[
i
],
"/?"
)
==
0
)
{
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
||
strcmp
(
argv
[
i
],
"--usage"
)
==
0
||
strcmp
(
argv
[
i
],
"-?"
)
==
0
||
strcmp
(
argv
[
i
],
"/?"
)
==
0
)
{
shellParseSingleOpt
(
'?'
,
NULL
);
return
0
;
}
...
...
@@ -263,10 +264,8 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
return
-
1
;
}
if
(
key
[
1
]
==
'h'
||
key
[
1
]
==
'P'
||
key
[
1
]
==
'u'
||
key
[
1
]
==
'a'
||
key
[
1
]
==
'c'
||
key
[
1
]
==
's'
||
key
[
1
]
==
'f'
||
key
[
1
]
==
'd'
||
key
[
1
]
==
'w'
||
key
[
1
]
==
'n'
||
key
[
1
]
==
'l'
||
key
[
1
]
==
'N'
if
(
key
[
1
]
==
'h'
||
key
[
1
]
==
'P'
||
key
[
1
]
==
'u'
||
key
[
1
]
==
'a'
||
key
[
1
]
==
'c'
||
key
[
1
]
==
's'
||
key
[
1
]
==
'f'
||
key
[
1
]
==
'd'
||
key
[
1
]
==
'w'
||
key
[
1
]
==
'n'
||
key
[
1
]
==
'l'
||
key
[
1
]
==
'N'
#ifdef WEBSOCKET
||
key
[
1
]
==
'E'
||
key
[
1
]
==
'T'
#endif
...
...
@@ -282,12 +281,10 @@ int32_t shellParseArgsWithoutArgp(int argc, char *argv[]) {
}
shellParseSingleOpt
(
key
[
1
],
val
);
i
++
;
}
else
if
(
key
[
1
]
==
'p'
||
key
[
1
]
==
'A'
||
key
[
1
]
==
'C'
||
key
[
1
]
==
'r'
||
key
[
1
]
==
'k'
||
key
[
1
]
==
't'
||
key
[
1
]
==
'V'
||
key
[
1
]
==
'?'
||
key
[
1
]
==
1
}
else
if
(
key
[
1
]
==
'p'
||
key
[
1
]
==
'A'
||
key
[
1
]
==
'C'
||
key
[
1
]
==
'r'
||
key
[
1
]
==
'k'
||
key
[
1
]
==
't'
||
key
[
1
]
==
'V'
||
key
[
1
]
==
'?'
||
key
[
1
]
==
1
#ifdef WEBSOCKET
||
key
[
1
]
==
'R'
||
key
[
1
]
==
'R'
#endif
)
{
shellParseSingleOpt
(
key
[
1
],
NULL
);
...
...
@@ -420,9 +417,15 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) {
sprintf
(
promptContinueFormat
,
"%%%zus> "
,
strlen
(
cusPrompt
));
sprintf
(
shell
.
info
.
promptContinue
,
promptContinueFormat
,
" "
);
shell
.
info
.
promptSize
=
strlen
(
shell
.
info
.
promptHeader
);
#ifdef TD_ENTERPRISE
snprintf
(
shell
.
info
.
programVersion
,
sizeof
(
shell
.
info
.
programVersion
),
"version: %s compatible_version: %s
\n
gitinfo: %s
\n
gitinfoOfInternal: %s
\n
buildInfo: %s"
,
version
,
compatible_version
,
gitinfo
,
gitinfoOfInternal
,
buildinfo
);
#else
snprintf
(
shell
.
info
.
programVersion
,
sizeof
(
shell
.
info
.
programVersion
),
"version: %s compatible_version: %s
\n
gitinfo: %s
\n
buildInfo: %s"
,
version
,
compatible_version
,
gitinfo
,
buildinfo
);
#endif
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
shell
.
info
.
osname
=
"Windows"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录