diff --git a/trace_streamer/build/build_stanalone_plugins.sh b/trace_streamer/build/build_stanalone_plugins.sh index efccaa1a735d8c833ba058e4d58349f1de379a0e..e4d9939bbebab462d79898a0bd1b17403aadbd52 100644 --- a/trace_streamer/build/build_stanalone_plugins.sh +++ b/trace_streamer/build/build_stanalone_plugins.sh @@ -14,16 +14,8 @@ set -e . build/build_base.sh -function init_vars() { - TARGET_PATH="" - PROJ_PATH="" - SCRIPT_PATH=$(dirname "$(readlink -f "$0")") - flag="false" - IFS=',' -} - function check_plugin_true() { - if [ $1 == "false" ];then + if [ "$1" == "false" ];then echo "Current plugins haven't '$2'!Please check!" exit fi @@ -33,6 +25,7 @@ function enable_plugin() { check_params $1 set_enable_plugin_array "false" read -ra plugins <<< "$1" + local flag='false' for plugin in "${plugins[@]}"; do for enable_plugin in "${enable_plugin_array[@]}"; do if [[ "$enable_plugin" == *"$plugin"* ]]; then @@ -50,17 +43,17 @@ function enable_extend_plugin() { check_params "$1" set_enable_extend_plugin_array "false" read -ra plugins <<< "$1" + local flag_extend='false' for plugin in "${plugins[@]}"; do for enable_extend_plugin in "${enable_extend_plugin_array[@]}"; do if [[ "$enable_extend_plugin" == *"$plugin"* ]]; then eval "$enable_extend_plugin=\"true\"" echo "$enable_extend_plugin=${!enable_extend_plugin}" - flag="true" + flag_extend="true" fi done - check_plugin_true $flag $plugin - flag="false" + check_plugin_true $flag_extend $plugin + flag_extend="false" done } -init_vars diff --git a/trace_streamer/build/protoc_w.py b/trace_streamer/build/protoc_w.py index 3dd7b13a4a1de30832f345213cb58bad9f5ace55..de4cfdcdb1ca9b81ef1858d06ecf4e8bfdc6fcea 100755 --- a/trace_streamer/build/protoc_w.py +++ b/trace_streamer/build/protoc_w.py @@ -49,7 +49,7 @@ PARAMS_ALL = f"{PARAMS_SRC}" if not sys.argv[4].startswith("--plugin"): if os.path.isfile(OPT_PLUGIN_PROTOREADER_PATH): - cmd=[PROTOC, OPT_PLUGIN_PROTOREADER, f"{PLUGINOUT}:{sys.argv[5]}", *PARAMS_ALL.split()] + cmd = [PROTOC, OPT_PLUGIN_PROTOREADER, f"{PLUGINOUT}:{sys.argv[5]}", *PARAMS_ALL.split()] print("执行参数:--------------- ", cmd, " --------------------------") subprocess.run(cmd) subprocess.run([PROTOC, *PARAMS_ALL.split()]) diff --git a/trace_streamer/build/sync_base.sh b/trace_streamer/build/sync_base.sh deleted file mode 100644 index f5aa2434028755053c16a5e79a779365bef6e4d2..0000000000000000000000000000000000000000 --- a/trace_streamer/build/sync_base.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -e - -function init_vars() { - TARGET_PATH="" - PROJ_PATH="" - SCRIPT_PATH=$(dirname "$(readlink -f "$0")") -} - -function help() { - echo "Usage: $1 [-p ]" - echo " -p , set the sync target path." - echo " -h Show the help info." - exit -} - -function parser_param() { - while [[ $# -gt 0 ]]; do - case "$1" in - -p) - TARGET_PATH="$2" - shift 2;; - -h) - help $0 - shift;; - *) - shift;; - esac - done -} - -function check_target_path() { - if [ -z "$TARGET_PATH" ]; then - echo "target path is empty!" - help $0 - exit - fi -} -function set_cur_proj_path() { - PROJ_PATH=$(dirname "$(readlink -f "$0")") -} -init_vars -echo $SCRIPT_PATH\ \ No newline at end of file