diff --git a/component/BiShengJDK17/check_install_result.sh b/component/BiShengJDK17/check_install_result.sh index 77ccfcd767ecce29d58c3d1690890e9ed932f277..dca8d3bece1231181b09b13726139b2540101c15 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 732fd0bf2b1445b0ed0846da44759f88f20dc9c3..97905e0fb00f16aacae79802278e82818e01796f 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 0c83b79f02501abed27592f567c2d97f296a9296..7725c0b1d4d659e8b427d938696128067df0ed01 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 2e015e75914d065c22ed30227e6d900d4d8906d4..46062f3c21edf4efdcda6610f80593c3223e7f7a 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 diff --git a/component/CompatibilityTesting/install.sh b/component/CompatibilityTesting/install.sh index 96ed4c585aad3b97073b1d3fa96e22000a80330d..00cf97dd183fcbc005e3404cd5e96027bbb602cc 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 81bc7810e6b5db9805a317399baf503cf888b2d1..85f5500295582ed98f6c61247801aab013dcd67c 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 ecf4a0a8e93226da127360c3209fa02549a754b1..424402ba92c742dcb227a0a8fe7ee67fa92efcbf 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/config/machine.yaml b/tools/download_and_deploy/config/machine.yaml index 78b77653c6ff78d9b1ae534d4d5ea38a8f920d57..86b11f4cf3c62074fc3d539c5220ee1c88b4f301 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/component_install/devkitcli_deploy.py b/tools/download_and_deploy/src/component_install/devkitcli_deploy.py index 5c15ce2e685a609b5c35b188901ed4ba510e33b0..71a049f4b0adfb5cf35b4941d5fdfee4e3348ec4 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 diff --git a/tools/download_and_deploy/src/constant.py b/tools/download_and_deploy/src/constant.py index 212e795d2376b3d579347a843b4110ba08ce6b8a..1dc4a9d62df71ff681dd4d7c90428c6530865086 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 cb75c11bffe5910b0d5ec09a10e44ea9ab8a9c20..c83766e3058dbf13fc4e48675a7e4f5946782fab 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 373bd57882a78e9b0948924299dfb0d433c563c0..e41c224538b87db8dc44e9d0311d97cdf02749c6 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: