diff options
author | Youngjae Cho <y0.cho@samsung.com> | 2024-09-09 20:06:39 +0900 |
---|---|---|
committer | Youngjae Cho <y0.cho@samsung.com> | 2024-09-10 15:15:59 +0900 |
commit | 41fe799518f2726c90878006ce382637dfb98550 (patch) | |
tree | 33793bce8c7850e1b36574f9204ede7621df7286 | |
parent | 01bc5a77d3775cea5d561c1afd5866f297ed5344 (diff) | |
download | rootstrap-checker-accepted/tizen_base_x.tar.gz rootstrap-checker-accepted/tizen_base_x.tar.bz2 rootstrap-checker-accepted/tizen_base_x.zip |
Fix style of function local variablestizen_9.0_m2_releaseaccepted/tizen/base/x/asan/20241010.014058accepted/tizen/base/x/20240913.063732accepted/tizen/base/toolchain/20241004.030038accepted/tizen/base/asan/20241029.053919accepted/tizen/base/20241121.211424accepted/tizen/base/20241121.055534accepted/tizen/base/20240913.042530accepted/tizen/9.0/base/20241030.075842accepted/tizen_base_x_asanaccepted/tizen_base_xaccepted/tizen_base_toolchainaccepted/tizen_base_asanaccepted/tizen_9.0_base
Fix it to be lowercase, prefixed with local keyword.
Change-Id: Ib4769d191444a27bd17549ddf729554fcf7f211a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r-- | packaging/hal-rootstrap-checker.sh | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/packaging/hal-rootstrap-checker.sh b/packaging/hal-rootstrap-checker.sh index b1215fb..e4e1701 100644 --- a/packaging/hal-rootstrap-checker.sh +++ b/packaging/hal-rootstrap-checker.sh @@ -12,59 +12,62 @@ UNSPECIFIED="Unspecified" LINE_MAX_LENGTH=90 print_border() { - PLACEHOLDER=$(printf "%*s" "$LINE_MAX_LENGTH" " ") - echo ${PLACEHOLDER// /\#} + local placeholder=$(printf "%*s" "$LINE_MAX_LENGTH" " ") + echo ${placeholder// /\#} } print_message() { - MESSAGE_MAX_LENGTH=$(($LINE_MAX_LENGTH - 3)) - printf "# %-*s#\n" "$MESSAGE_MAX_LENGTH" "$1" + local message_max_length=$(($LINE_MAX_LENGTH - 3)) + printf "# %-*s#\n" "$message_max_length" "$1" } print_not_allowed_log() { - WARNING_TYPE=$1 - NOT_ALLOWED_LIST=$2 - ALLOWED_PACKAGE_NAME_LIST=$3 - ALLOWED_GROUP_NAME_LIST=$4 - ACTION=$5 + local warning_type=$1 + local not_allowed_list=$2 + local allowed_package_name_list=$3 + local allowed_group_name_list=$4 + local action=$5 - if [[ "$ACTION" == "ignore" ]]; then + if [[ "$action" == "ignore" ]]; then return fi - PREFIX="WARNING" - if [[ "$ACTION" == "error" ]]; then - PREFIX="ERROR" + local prefix="WARNING" + if [[ "$action" == "error" ]]; then + prefix="ERROR" fi + local not_allowed="" + local allowed="" + print_border print_border - print_message "$PREFIX: There are not allowed $WARNING_TYPE. They might cause ABI break." - for NOT_ALLOWED in ${NOT_ALLOWED_LIST}; do - NOT_ALLOWED_PACKAGE_NAME="" - NOT_ALLOWED_GROUP_NAME="" - if [[ $NOT_ALLOWED =~ (.*)@(.*) ]]; then - NOT_ALLOWED_PACKAGE_NAME=${BASH_REMATCH[1]} - NOT_ALLOWED_GROUP_NAME=${BASH_REMATCH[2]} + print_message "$prefix: There are not allowed $warning_type. They might cause ABI break." + for not_allowed in ${not_allowed_list}; do + local not_allowed_package_name="" + local not_allowed_group_name="" + if [[ $not_allowed =~ (.*)@(.*) ]]; then + not_allowed_package_name=${BASH_REMATCH[1]} + not_allowed_group_name=${BASH_REMATCH[2]} fi - print_message "$PREFIX: - $NOT_ALLOWED_PACKAGE_NAME, Group: $NOT_ALLOWED_GROUP_NAME" + print_message "$prefix: - $not_allowed_package_name, Group: $not_allowed_group_name" done - print_message "$PREFIX:" - if [[ ! -z $ALLOWED_PACKAGE_NAME_LIST ]]; then - print_message "$PREFIX: Use only allowed packages below for $WARNING_TYPE" - for ALLOWED in ${ALLOWED_PACKAGE_NAME_LIST}; do - print_message "$PREFIX: - $ALLOWED" + print_message "$prefix:" + if [[ ! -z $allowed_package_name_list ]]; then + print_message "$prefix: Use only allowed packages below for $warning_type" + for allowed in ${allowed_package_name_list}; do + print_message "$prefix: - $allowed" done else - print_message "$PREFIX: It is not allowed to specify $WARNING_TYPE" + print_message "$prefix: It is not allowed to specify $warning_type" fi - if [[ ! -z $ALLOWED_GROUP_NAME_LIST ]]; then - print_message "$PREFIX: Use only allowed package groups below for $WARNING_TYPE" - for ALLOWED in ${ALLOWED_GROUP_NAME_LIST}; do - print_message "$PREFIX: - $ALLOWED" + if [[ ! -z $allowed_group_name_list ]]; then + print_message "$prefix: Use only allowed package groups below for $warning_type" + for allowed in ${allowed_group_name_list}; do + print_message "$prefix: - $allowed" done fi |