Skip to content

Commit

Permalink
chore: refactor cus name (#632)
Browse files Browse the repository at this point in the history
* chore: support cus name

* fix: codacy errors

* chore: refactor cus email

* test: change test branch

* fix: ../src/benchSys.c

* fix: revert taosbenchmark yaml
  • Loading branch information
sangshuduo committed Mar 30, 2023
1 parent 87dcd2e commit d194dc9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/3.0-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
|| github.event_name == 'push'
shell: alpine.sh --root {0}
run: |
git clone --branch fix/sangshuduo/TD-23292-taosbenchmark-same-min-max --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1
git clone --branch chore/sangshuduo/TS-2690-cus-name --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1
cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_TOOLS=true -DTOOLS_BUILD_TYPE=${{env.TOOLS_BUILD_TYPE}} -DBUILD_HTTP=false && make -j8 && make install
if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taos ]]
then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'fix/sangshuduo/TD-23292-taosbenchmark-same-min-max'
ref: 'chore/sangshuduo/TS-2690-cus-name'

- name: create debug directory
if: |
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ ENDIF ()
MESSAGE("Current system is: ${CMAKE_SYSTEM_NAME}")

IF (CUS_NAME OR CUS_PROMPT OR CUS_EMAIL)
ADD_DEFINITIONS(-I${CMAKE_CURRENT_SOURCE_DIR}/../../../../enterprise/packaging)
ADD_DEFINITIONS(-I${CMAKE_CURRENT_SOURCE_DIR}/../../../../community/include/util)
ENDIF (CUS_NAME OR CUS_PROMPT OR CUS_EMAIL)

IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand Down
16 changes: 8 additions & 8 deletions src/benchSys.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@

extern char version[];

#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
#include "cus_name.h"
#else
#ifndef CUS_NAME
char cusName[] = "TDengine";
#define CUS_NAME "TDengine"
#endif

#ifndef CUS_PROMPT
char cusPrompt[] = "taos";
#define CUS_PROMPT "taos"
#endif

#ifndef CUS_EMAIL
char cusEmail[] = "<support@taosdata.com>";
#define CUS_EMAIL "<support@taosdata.com>"
#endif

#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
#include "cus_name.h"
#endif

#ifdef WINDOWS
Expand Down Expand Up @@ -94,7 +94,7 @@ void benchPrintHelp() {
printf("%s%s%s%s\r\n", indent, "-v,", indent, BENCH_VGROUPS);
#endif
printf("%s%s%s%s\r\n", indent, "-V,", indent, BENCH_VERSION);
printf("\r\n\r\nReport bugs to %s.\r\n", cusEmail);
printf("\r\n\r\nReport bugs to %s.\r\n", CUS_EMAIL);
}

int32_t benchParseArgsNoArgp(int argc, char* argv[]) {
Expand Down Expand Up @@ -168,7 +168,7 @@ int32_t benchParseArgsNoArgp(int argc, char* argv[]) {
}
#else
const char * argp_program_version = version;
const char * argp_program_bug_address = cusEmail;
const char * argp_program_bug_address = CUS_EMAIL;

static struct argp_option bench_options[] = {
{"file", 'f', "FILE", 0, BENCH_FILE, 0},
Expand Down
14 changes: 7 additions & 7 deletions src/taosdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@
#include <taosws.h>
#endif

#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
#include "cus_name.h"
#else
#ifndef CUS_NAME
char cusName[] = "TDengine";
#define CUS_NAME "TDengine"
#endif

#ifndef CUS_PROMPT
char cusPrompt[] = "taos";
#define CUS_PROMPT "taos"
#endif

#ifndef CUS_EMAIL
char cusEmail[] = "<support@taosdata.com>";
#define CUS_EMAIL "<support@taosdata.com>"
#endif

#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL)
#include "cus_name.h"
#endif

// get taosdump commit number version
Expand Down Expand Up @@ -416,7 +416,7 @@ static char args_doc[] = "dbname [tbname ...]\n--databases db1,db2,... \n"
/* Keys for options without short-options. */
#define OPT_ABORT 1 /* –abort */

const char * argp_program_bug_address = cusEmail;
const char * argp_program_bug_address = CUS_EMAIL;

/* The options we understand. */
static struct argp_option options[] = {
Expand Down

0 comments on commit d194dc9

Please sign in to comment.