sed_pro.sh 8.1 KB
Newer Older
1 2
#!/bin/bash

Z
change  
zyyang 已提交
3
function replace_community_pro() {
4 5 6 7
  # cmake/install.inc
  sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/cmake/install.inc
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/cmake/install.inc
  sed -i "s/taos\.exe/prodbc\.exe/g" ${top_dir}/cmake/install.inc
Z
change  
zyyang 已提交
8 9
  # src/kit/shell/CMakeLists.txt
  sed -i "s/OUTPUT_NAME taos/OUTPUT_NAME prodbc/g" ${top_dir}/src/kit/shell/CMakeLists.txt
10 11 12 13 14
  # src/kit/shell/inc/shell.h
  sed -i "s/taos_history/prodb_history/g" ${top_dir}/src/kit/shell/inc/shell.h
  # src/inc/taosdef.h
  sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/src/inc/taosdef.h
  # src/util/src/tconfig.c
Z
change  
zyyang 已提交
15 16
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/src/util/src/tconfig.c
  sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/src/util/src/tconfig.c
17
  # src/util/src/tlog.c
Z
change  
zyyang 已提交
18
  sed -i "s/log\/taos/log\/ProDB/g" ${top_dir}/src/util/src/tlog.c
19 20
  # src/dnode/src/dnodeSystem.c
  sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeSystem.c
Z
change  
zyyang 已提交
21 22
  sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeMain.c
  sed -i "s/taosdlog/prodlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
23
  # src/client/src/tscSystem.c
Z
change  
zyyang 已提交
24
  sed -i "s/taoslog/prolog/g" ${top_dir}/src/client/src/tscSystem.c
25
  # src/util/src/tnote.c
Z
change  
zyyang 已提交
26
  sed -i "s/taosinfo/proinfo/g" ${top_dir}/src/util/src/tnote.c
27
  # src/dnode/CMakeLists.txt
Z
change  
zyyang 已提交
28 29
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
  echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME prodbs)" >>${top_dir}/src/dnode/CMakeLists.txt
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
  # src/os/src/linux/linuxEnv.c
  sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c
  sed -i "s/lib\/taos/lib\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c
  sed -i "s/log\/taos/log\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c
  # src/kit/shell/src/shellDarwin.c
  sed -i "s/TDengine shell/ProDB shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
  sed -i "s/2020 by TAOS Data/2021 by HanaTech/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
  # src/kit/shell/src/shellLinux.c
  sed -i "s/support@taosdata\.com/support@hanatech\.com\.cn/g" ${top_dir}/src/kit/shell/src/shellLinux.c
  sed -i "s/TDengine shell/ProDB shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
  sed -i "s/2020 by TAOS Data/2021 by HanaTech/g" ${top_dir}/src/kit/shell/src/shellLinux.c
  # src/os/src/windows/wEnv.c
  sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/src/os/src/windows/wEnv.c
  # src/kit/shell/src/shellEngine.c
  sed -i "s/TDengine shell/ProDB shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
  sed -i "s/2020 by TAOS Data, Inc/2021 by Hanatech, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c
  sed -i "s/taos connect failed/prodbc connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
  sed -i "s/\"taos> \"/\"ProDB> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
  sed -i "s/\"   -> \"/\"    -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
  sed -i "s/prompt_size = 6/prompt_size = 7/g" ${top_dir}/src/kit/shell/src/shellEngine.c
  # src/rpc/src/rpcMain.c
  sed -i "s/taos connections/prodbc connections/g" ${top_dir}/src/rpc/src/rpcMain.c
  # src/plugins/monitor/src/monMain.c
  sed -i "s/taosd is quiting/prodbs is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
Z
change  
zyyang 已提交
54 55 56 57 58 59 60 61 62
  # packaging/rpm/taosd
  sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/rpm/taosd
  sed -i "s/usr\/local\/taos/usr\/local\/ProDB/g" ${top_dir}/packaging/rpm/taosd
  sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/rpm/taosd
  # packaging/deb/taosd
  sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/deb/taosd
  sed -i "s/usr\/local\/taos/usr\/local\/ProDB/g" ${top_dir}/packaging/deb/taosd
  sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/deb/taosd
  # packaging/tools/install.sh
Z
change  
zyyang 已提交
63 64
  sed -i "s/var\/lib\/taos/var\/lib\/ProDB/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/var\/log\/taos/var\/log\/ProDB/g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
65
  sed -i "s/usr\/local\/taos/usr\/local\/ProDB/g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
66
  sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
67
  sed -i "s/taosdata\.com/hanatech\.com\.cn/g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
68 69
  sed -i "s/\${bin_link_dir}\/taos /\${bin_link_dir}\/prodbc /g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/\${bin_link_dir}\/taosd /\${bin_link_dir}\/prodbs /g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
70
  sed -i "s/\${bin_link_dir}\/rmtaos /\${bin_link_dir}\/rmpro /g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
  sed -i "s/bin\/taos /bin\/prodbc /g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/bin\/taosd /bin\/prodbs /g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/ taosd / prodbs /g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/\${service_config_dir}\/taosd/\${service_config_dir}\/prodbs/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/init\.d\/taosd/init\.d\/prodbs/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/--quiet taosd/--quiet prodbs/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/cfg\/taosd\.service/cfg\/prodbs\.service/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/taos\.tar\.gz/prodb\.tar\.gz/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/systemctl start taosd/systemctl start prodbs/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/\.\/taosd/\.\/prodbs/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/taos -h/prodbc -h/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/taosd --force-keep-file/prodbs --force-keep-file/g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/taos_history/prodb_history/g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
86 87
  sed -i "s/\${bin_dir}\/taosd /\${bin_dir}\/prodbs /g" ${top_dir}/packaging/tools/install.sh
  sed -i "s/\${bin_dir}\/taos /\${bin_dir}\/prodbc /g" ${top_dir}/packaging/tools/install.sh
Z
change  
zyyang 已提交
88 89 90 91 92 93 94 95
  # packaging/tools/remove.sh
  sed -i "s/usr\/local\/taos/usr\/local\/ProDB/g" ${top_dir}/packaging/tools/remove.sh
  sed -i "s/\"taosd\"/\"prodbs\"/g" ${top_dir}/packaging/tools/remove.sh
  sed -i "s/\${bin_link_dir}\/taos /\${bin_link_dir}\/prodbc /g" ${top_dir}/packaging/tools/remove.sh
  sed -i "s/\${bin_link_dir}\/taosd /\${bin_link_dir}\/prodbs /g" ${top_dir}/packaging/tools/remove.sh
  sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/tools/remove.sh
  sed -i "s/ taosd / prodbs /g" ${top_dir}/packaging/tools/remove.sh

96 97
}

Z
change  
zyyang 已提交
98
function replace_enterprise_pro() {
99 100 101 102
  # enterprise/src/kit/perfMonitor/perfMonitor.c
  sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
  sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
  # enterprise/src/plugins/admin/src/httpAdminHandle.c
Z
change  
zyyang 已提交
103
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c
104
  # enterprise/src/plugins/grant/src/grantMain.c
Z
change  
zyyang 已提交
105
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c
106
  # enterprise/src/plugins/module/src/moduleMain.c
Z
change  
zyyang 已提交
107 108 109
  sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c

  # enterprise/src/plugins/web
Z
change  
zyyang 已提交
110 111 112
  sed -i -e "s/www\.taosdata\.com/www\.hanatech\.com\.cn/g" $(grep -r "www.taosdata.com" ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
  sed -i -e "s/TAOS Data/Hanatech/g" $(grep -r "TAOS Data" ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
  sed -i -e "s/taosd/prodbs/g" $(grep -r "taosd" ${top_dir}/../enterprise/src/plugins/web | grep -E "*\.js\s*.*" | sed -r -e "s/(.*\.js):\s*(.*)/\1/g" | sort | uniq)
Z
change  
zyyang 已提交
113
  # enterprise/src/plugins/web/admin/monitor.html
Z
change  
zyyang 已提交
114
  sed -i -e "s/<th style=\"font-weight: normal\">taosd<\/th>/<th style=\"font-weight: normal\">prodbs<\/th>/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
Z
change  
zyyang 已提交
115 116 117 118 119 120
  sed -i -e "s/data:\['taosd', 'system'\],/data:\['prodbs', 'system'\],/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
  sed -i -e "s/name: 'taosd',/name: 'prodbs',/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
  # enterprise/src/plugins/web/admin/*.html
  sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/plugins/web/admin/*.html
  # enterprise/src/plugins/web/admin/js/*.js
  sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/plugins/web/admin/js/*.js
121
}