From af4beb6f03b95239090e1fb9e5f812afcb655522 Mon Sep 17 00:00:00 2001 From: yagagagaga Date: Wed, 18 Dec 2024 20:28:43 +0800 Subject: [PATCH 1/2] [chore](bash) fix `start_fe.sh --version` not work and MetaService scripts occur error in ebian GNU/Linux 11 (bullseye) --- bin/start_fe.sh | 6 ++++++ cloud/script/start.sh | 2 +- cloud/script/stop.sh | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/start_fe.sh b/bin/start_fe.sh index ac5971072c306c..a1979f03f1352e 100755 --- a/bin/start_fe.sh +++ b/bin/start_fe.sh @@ -258,6 +258,12 @@ if [[ "${HELPER}" != "" ]]; then HELPER="-helper ${HELPER}" fi +if [[ "$OPT_VERSION" != "" ]]; then + export DORIS_LOG_TO_STDERR=1 + ${LIMIT:+${LIMIT}} "${JAVA}" org.apache.doris.DorisFE --version + exit 0 +fi + if [[ "${IMAGE_TOOL}" -eq 1 ]]; then if [[ -n "${IMAGE_PATH}" ]]; then ${LIMIT:+${LIMIT}} "${JAVA}" ${final_java_opt:+${final_java_opt}} ${coverage_opt:+${coverage_opt}} org.apache.doris.DorisFE -i "${IMAGE_PATH}" diff --git a/cloud/script/start.sh b/cloud/script/start.sh index 1bce9813f4cf52..ecb5a3b2bed1e6 100644 --- a/cloud/script/start.sh +++ b/cloud/script/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information diff --git a/cloud/script/stop.sh b/cloud/script/stop.sh index 48f01c545ae840..1b59cef718243e 100644 --- a/cloud/script/stop.sh +++ b/cloud/script/stop.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information From 08ad0d22f1a751a54efe10845fa7d1fa8e46e5bd Mon Sep 17 00:00:00 2001 From: yagagagaga Date: Wed, 18 Dec 2024 20:35:54 +0800 Subject: [PATCH 2/2] fix sh badsmell --- bin/start_fe.sh | 2 +- gensrc/script/gen_build_version.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/start_fe.sh b/bin/start_fe.sh index a1979f03f1352e..b089596a9cdb73 100755 --- a/bin/start_fe.sh +++ b/bin/start_fe.sh @@ -258,7 +258,7 @@ if [[ "${HELPER}" != "" ]]; then HELPER="-helper ${HELPER}" fi -if [[ "$OPT_VERSION" != "" ]]; then +if [[ "${OPT_VERSION}" != "" ]]; then export DORIS_LOG_TO_STDERR=1 ${LIMIT:+${LIMIT}} "${JAVA}" org.apache.doris.DorisFE --version exit 0 diff --git a/gensrc/script/gen_build_version.sh b/gensrc/script/gen_build_version.sh index a85effebd5e3bb..6b6852199682b0 100755 --- a/gensrc/script/gen_build_version.sh +++ b/gensrc/script/gen_build_version.sh @@ -35,7 +35,7 @@ build_version_hotfix=0 build_version_rc_version="" build_version="${build_version_prefix}-${build_version_major}.${build_version_minor}.${build_version_patch}" -if [[ ${build_version_hotfix} > 0 ]]; then +if [[ ${build_version_hotfix} -gt 0 ]]; then build_version+=".${build_version_hotfix}" fi build_version+="-${build_version_rc_version}" @@ -225,7 +225,7 @@ fi build_version="${build_version_prefix}-${build_version_major}.${build_version_minor}.${build_version_patch}" -if [[ ${build_version_hotfix} > 0 ]]; then +if [[ ${build_version_hotfix} -gt 0 ]]; then build_version+=".${build_version_hotfix}" fi