From dcdff986f6b19d307e38dd6da6f50b8daaf75327 Mon Sep 17 00:00:00 2001 From: cc <18856836718@163.com> Date: Fri, 14 Jun 2024 16:25:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9DevKit=20Cli=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=96=B9=E5=BC=8F=EF=BC=8C=E4=B8=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=BD=AF=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/CompatibilityTesting/install.sh | 1 + component/DevKitCLI/check_install_result.sh | 2 +- component/DevKitCLI/install.sh | 24 ++++++++++++++----- .../src/component_install/devkitcli_deploy.py | 1 - 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/component/CompatibilityTesting/install.sh b/component/CompatibilityTesting/install.sh index 96ed4c5..00cf97d 100644 --- a/component/CompatibilityTesting/install.sh +++ b/component/CompatibilityTesting/install.sh @@ -4,6 +4,7 @@ set -e function main (){ + mkdir -p ${HOME}/.local compatibility_test_tar=/tmp/devkitdependencies/compatibility_testing.tar.gz echo "Decompress compatibility_testing.tar.gz to ${HOME}/.local" tar --no-same-owner -zxf ${compatibility_test_tar} -C ${HOME}/.local/ diff --git a/component/DevKitCLI/check_install_result.sh b/component/DevKitCLI/check_install_result.sh index 81bc781..85f5500 100644 --- a/component/DevKitCLI/check_install_result.sh +++ b/component/DevKitCLI/check_install_result.sh @@ -1,7 +1,7 @@ #!/bin/bash devkit_path=$(which devkit) -if [[ -f ${HOME}/.local/DevKit-CLI-24.0.RC1-Linux-Kunpeng/devkit ]] && [[ ${devkit_path} == /usr/local/bin/devkit ]]; then +if [[ ${devkit_path} == ${HOME}/.local/DevKit-CLI-24.0.RC1-Linux-Kunpeng/devkit ]]; then echo "true" else echo "false" diff --git a/component/DevKitCLI/install.sh b/component/DevKitCLI/install.sh index ecf4a0a..424402b 100644 --- a/component/DevKitCLI/install.sh +++ b/component/DevKitCLI/install.sh @@ -2,9 +2,21 @@ set -e cd /tmp/devkitdependencies/ -mkdir -p ${HOME}/.local -echo "Decompress DevKit-CLI-24.0.RC1-Linux-Kunpeng.tar.gz to ${HOME}/.local" -tar --no-same-owner -zxf /tmp/devkitdependencies/DevKit-CLI-24.0.RC1-Linux-Kunpeng.tar.gz -C ${HOME}/.local -echo "Decompress DevKit-CLI-24.0.RC1-Linux-Kunpeng.tar.gz to ${HOME}/.local finished." -sudo ln -s ${HOME}/.local/DevKit-CLI-24.0.RC1-Linux-Kunpeng/devkit /usr/local/bin -echo "create DevkitCLI soft-link success." +function main() { + mkdir -p ${HOME}/.local + echo "Decompress DevKit-CLI-24.0.RC1-Linux-Kunpeng.tar.gz to ${HOME}/.local" + tar --no-same-owner -zxf /tmp/devkitdependencies/DevKit-CLI-24.0.RC1-Linux-Kunpeng.tar.gz -C ${HOME}/.local + echo "Decompress DevKit-CLI-24.0.RC1-Linux-Kunpeng.tar.gz to ${HOME}/.local finished." + + echo "change ${HOME}/.bashrc" + sed -i '/DevKit-CLI-24.0.RC1-Linux-Kunpeng/d' ${HOME}/.bashrc + cat >> ${HOME}/.bashrc <<'EOF' +export PATH=${HOME}/.local/DevKit-CLI-24.0.RC1-Linux-Kunpeng:${PATH} +EOF + + echo "source ${HOME}/.bashrc" + set +x + source ${HOME}/.bashrc +} + +main "$@" \ No newline at end of file diff --git a/tools/download_and_deploy/src/component_install/devkitcli_deploy.py b/tools/download_and_deploy/src/component_install/devkitcli_deploy.py index 5c15ce2..71a049f 100644 --- a/tools/download_and_deploy/src/component_install/devkitcli_deploy.py +++ b/tools/download_and_deploy/src/component_install/devkitcli_deploy.py @@ -10,4 +10,3 @@ class DevkitCLIDeploy(DeployBase): os.path.join("/tmp", constant.DEPENDENCY_DIR, "DevKitCLI" + "install.sh"), os.path.join("/tmp", constant.DEPENDENCY_DIR, "DevKitCLI" + "check_install_result.sh"), ] - sudo = True -- Gitee From 2854d9b4cb6182dcee1d53ceb2c3992969b85a76 Mon Sep 17 00:00:00 2001 From: cc <18856836718@163.com> Date: Sat, 15 Jun 2024 15:04:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8F=96=E6=B6=88executor=E8=A7=92?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/download_and_deploy/config/machine.yaml | 2 -- tools/download_and_deploy/src/constant.py | 4 +--- tools/download_and_deploy/src/handler/base_yaml_check.py | 2 +- tools/download_and_deploy/src/handler/compress_dep.py | 4 ++++ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/download_and_deploy/config/machine.yaml b/tools/download_and_deploy/config/machine.yaml index 78b7765..86b11f4 100644 --- a/tools/download_and_deploy/config/machine.yaml +++ b/tools/download_and_deploy/config/machine.yaml @@ -12,8 +12,6 @@ java_builder_jdk8: - 192.168.0.1 java_builder_jdk17: - 192.168.0.1 -executor: - - 192.168.0.1 compatibility: - 192.168.0.1 tester: diff --git a/tools/download_and_deploy/src/constant.py b/tools/download_and_deploy/src/constant.py index 212e795..1dc4a9d 100644 --- a/tools/download_and_deploy/src/constant.py +++ b/tools/download_and_deploy/src/constant.py @@ -12,7 +12,6 @@ JAVA_BUILDER = "java_builder" JAVA_BUILDER_JDK8 = "java_builder_jdk8" JAVA_BUILDER_JDK17 = "java_builder_jdk17" -EXECUTOR = "executor" COMPATIBILITY = "compatibility" TESTER = "tester" @@ -28,7 +27,7 @@ ROLE_LIST = [ SCANNER, C_BUILDER, C_BUILDER_GCC, C_BUILDER_BISHENG_COMPILER, JAVA_BUILDER, JAVA_BUILDER_JDK8, JAVA_BUILDER_JDK17, - EXECUTOR, COMPATIBILITY, TESTER, + COMPATIBILITY, TESTER, DEVKIT, CLAMAV, ] @@ -41,7 +40,6 @@ ROLE_COMPONENT = { JAVA_BUILDER: ["BiShengJDK8", "BiShengJDK17"], JAVA_BUILDER_JDK8: ["BiShengJDK8"], JAVA_BUILDER_JDK17: ["BiShengJDK17"], - EXECUTOR: ["CompatibilityTesting"], COMPATIBILITY: ["CompatibilityTesting"], TESTER: ["DevKitTester"], DEVKIT: ["DevKitWeb"], diff --git a/tools/download_and_deploy/src/handler/base_yaml_check.py b/tools/download_and_deploy/src/handler/base_yaml_check.py index cb75c11..c83766e 100644 --- a/tools/download_and_deploy/src/handler/base_yaml_check.py +++ b/tools/download_and_deploy/src/handler/base_yaml_check.py @@ -11,7 +11,7 @@ MAX_SET = (constant.USER, constant.PKEY, constant.PASSWORD, constant.SCANNER, constant.C_BUILDER, constant.C_BUILDER_GCC, constant.C_BUILDER_BISHENG_COMPILER, constant.JAVA_BUILDER, constant.JAVA_BUILDER_JDK8, constant.JAVA_BUILDER_JDK17, - constant.EXECUTOR, constant.COMPATIBILITY, constant.TESTER, + constant.COMPATIBILITY, constant.TESTER, constant.DEVKIT, constant.CLAMAV) diff --git a/tools/download_and_deploy/src/handler/compress_dep.py b/tools/download_and_deploy/src/handler/compress_dep.py index 373bd57..e41c224 100644 --- a/tools/download_and_deploy/src/handler/compress_dep.py +++ b/tools/download_and_deploy/src/handler/compress_dep.py @@ -1,3 +1,4 @@ +import platform import tarfile import os import shutil @@ -7,6 +8,9 @@ from constant import DEPENDENCY_FILE, DEFAULT_PATH class CompressDep(Handler): def handle(self, _): + if platform.system() == "Linux": + return True + try: print(f"Now compress dependencies to {DEPENDENCY_FILE}...") with tarfile.open(DEPENDENCY_FILE, "w:gz") as tar: -- Gitee From f3413d2f2f31dac9a95c6a3db548650147b00362 Mon Sep 17 00:00:00 2001 From: cc <18856836718@163.com> Date: Sat, 15 Jun 2024 15:15:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=96=B0=E5=A2=9EJDK=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E6=97=B6=E9=85=8D=E7=BD=AE=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/BiShengJDK17/check_install_result.sh | 9 +++++++-- component/BiShengJDK17/install.sh | 15 +++++++++++++++ component/BiShengJDK8/check_install_result.sh | 11 ++++++++--- component/BiShengJDK8/install.sh | 17 +++++++++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/component/BiShengJDK17/check_install_result.sh b/component/BiShengJDK17/check_install_result.sh index 77ccfcd..dca8d3b 100644 --- a/component/BiShengJDK17/check_install_result.sh +++ b/component/BiShengJDK17/check_install_result.sh @@ -1,7 +1,12 @@ #!/bin/bash -if [[ -f ${HOME}/.local/bisheng-jdk-17.0.10/bin/java ]]; then +java_path=$(which java) +if [[ ${java_path} == ${HOME}/.local/bisheng-jdk-17.0.10/bin/java ]]; then echo "true" else - echo "false" + if [[ -f ${HOME}/.local/bisheng-jdk-17.0.10/bin/java ]] && [[ $(grep -A1 '^export JAVA_HOME=${HOME}/.local/bisheng-jdk-17.0.10$' ${HOME}/.bashrc | grep '^export PATH=${JAVA_HOME}/bin:${PATH}$' | wc -l) == "1" ]]; then + echo "true" + else + echo "false" + fi fi diff --git a/component/BiShengJDK17/install.sh b/component/BiShengJDK17/install.sh index 732fd0b..97905e0 100644 --- a/component/BiShengJDK17/install.sh +++ b/component/BiShengJDK17/install.sh @@ -9,3 +9,18 @@ if [[ ! -d ${HOME}/.local/bisheng-jdk-17.0.10 ]]; then tar --no-same-owner -zxf /tmp/devkitdependencies/bisheng-jdk-17.0.10-linux-aarch64.tar.gz -C ${HOME}/.local echo "Decompress bisheng-jdk-17.0.10-linux-aarch64.tar.gz to ${HOME}/.local finished." fi + +java_path=$(which java) +if [[ ${java_path} != ${HOME}/.local/bisheng-jdk-17.0.10/bin/java ]]; then + sed -i '/bisheng-jdk-17.0.10/d' ${HOME}/.bashrc + + echo "change ${HOME}/.bashrc" + cat >> ${HOME}/.bashrc <<'EOF' +export JAVA_HOME=${HOME}/.local/bisheng-jdk-17.0.10 +export PATH=${JAVA_HOME}/bin:${PATH} +EOF + + echo "source ${HOME}/.bashrc" + set +x + source ${HOME}/.bashrc +fi diff --git a/component/BiShengJDK8/check_install_result.sh b/component/BiShengJDK8/check_install_result.sh index 0c83b79..7725c0b 100644 --- a/component/BiShengJDK8/check_install_result.sh +++ b/component/BiShengJDK8/check_install_result.sh @@ -1,7 +1,12 @@ #!/bin/bash -if [[ -f ${HOME}/.local/bisheng-jdk1.8.0_402/bin/java ]]; then +java_path=$(which java) +if [[ ${java_path} == ${HOME}/.local/bisheng-jdk1.8.0_402/bin/java ]]; then echo "true" else - echo "false" -fi + if [[ -f ${HOME}/.local/bisheng-jdk1.8.0_402/bin/java ]] && [[ $(grep -A1 '^export JAVA_HOME=${HOME}/.local/bisheng-jdk1.8.0_402$' ${HOME}/.bashrc | grep '^export PATH=${JAVA_HOME}/bin:${PATH}$' | wc -l) == "1" ]]; then + echo "true" + else + echo "false" + fi +fi \ No newline at end of file diff --git a/component/BiShengJDK8/install.sh b/component/BiShengJDK8/install.sh index 2e015e7..46062f3 100644 --- a/component/BiShengJDK8/install.sh +++ b/component/BiShengJDK8/install.sh @@ -9,3 +9,20 @@ if [[ ! -d ${HOME}/.local/bisheng-jdk1.8.0_402 ]]; then tar --no-same-owner -zxf /tmp/devkitdependencies/bisheng-jdk-8u402-linux-aarch64.tar.gz -C ${HOME}/.local echo "Decompress bisheng-jdk-8u402-linux-aarch64.tar.gz to ${HOME}/.local finished." fi + +java_path=$(which java) +if [[ ${java_path} != ${HOME}/.local/bisheng-jdk1.8.0_402/bin/java ]]; then + sed -i '/bisheng-jdk1.8.0_402/d' ${HOME}/.bashrc + + echo "change ${HOME}/.bashrc" + cat >> ${HOME}/.bashrc <<'EOF' +export JAVA_HOME=${HOME}/.local/bisheng-jdk1.8.0_402 +export PATH=${JAVA_HOME}/bin:${PATH} +export CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar +export JRE_HOME=${JAVA_HOME}/jre +EOF + + echo "source ${HOME}/.bashrc" + set +x + source ${HOME}/.bashrc +fi \ No newline at end of file -- Gitee