diff --git a/scripts/readme.md b/scripts/readme.md index f055f941..cf3e26e6 100755 --- a/scripts/readme.md +++ b/scripts/readme.md @@ -41,7 +41,7 @@ $ cd ./scripts $ ./ge.sh env ``` -3.配置外部依赖服务器信息 +3.配置外部依赖服务器信息,社区安装跳过此步骤。 ```sh ge config -i=121.36.**.** -u=asc**, -p=Asc***\#@\!$ (Need add escape character \ before special charactor $、#、!) ``` @@ -49,7 +49,10 @@ ge config -i=121.36.**.** -u=asc**, -p=Asc***\#@\!$ (Need add escape charact 4.下载和安装构建所依赖的外部库 ```sh -$ ge update +社区安装 +$ ge update -p +非社区安装 +$ ge update ``` (注:进入容器后,`ge`命令已经自动注册进系统,因此容器内不需要写脚本全称) @@ -164,6 +167,7 @@ Usage: ge update [OPTIONS] update dependencies of build and test Options: + -p, --public Download dependencies from community -d, --download Download dependencies -i, --install Install dependencies -c, --clear Clear dependencies diff --git a/scripts/update/ge_update.sh b/scripts/update/ge_update.sh index f1a42057..faf23015 100755 --- a/scripts/update/ge_update.sh +++ b/scripts/update/ge_update.sh @@ -34,6 +34,19 @@ function extract_deps_so() ./${DEV_TOOLS_PACKAGE}/${FWKACL_RUN_NAME} --noexec --extract=${DEP_TMP_DIR}/fwkacllib } +function extract_deps_so_community() +{ + echo "begin to extract .run file ........." + chmod 777 ./${DRIVER_RUN_NAME_C} + chmod 777 ./${PACKAGE_NAME_C} + [ -n "${DEP_TMP_DIR}" ] && rm -rf "${DEP_TMP_DIR}" + ./${DRIVER_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/driver + ./${PACKAGE_NAME_C} --noexec --extract=${DEP_TMP_DIR}/Packages_tmp + ${DEP_TMP_DIR}/Packages_tmp/run_package/${ATC_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/atc + ${DEP_TMP_DIR}/Packages_tmp/run_package/${ACL_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/acllib + ${DEP_TMP_DIR}/Packages_tmp/run_package/${FWKACL_RUN_NAME_C} --noexec --extract=${DEP_TMP_DIR}/fwkacllib +} + function copy_so_to_target_dir() { mkdir -p $DEP_LIB_DIR @@ -62,6 +75,19 @@ function download_runs() } +function download_runs_from_community +{ + source ${PROJECT_HOME}/scripts/update/deps_config_community.sh + echo "begin to download .run file from community........." + clear_libs + mkdir -p ./ ${DOWNLOAD_PATH} + pushd "${DOWNLOAD_PATH}" >/dev/null + cd ${DOWNLOAD_PATH} + wget ${DRIVER_URL_C} + wget ${PACKAGE_URL_C} + popd >/dev/null +} + function install_deps() { source scripts/update/deps_config.sh @@ -73,6 +99,16 @@ function install_deps() popd >/dev/null } +function install_deps_community() +{ + source ${PROJECT_HOME}/scripts/update/deps_config_community.sh + mkdir -p ./ ${DOWNLOAD_PATH} + pushd "${DOWNLOAD_PATH}" >/dev/null + cd ${DOWNLOAD_PATH} + extract_deps_so_community + copy_so_to_target_dir + popd >/dev/null +} function help(){ cat <<-EOF @@ -81,6 +117,7 @@ Usage: ge update [OPTIONS] update dependencies of build and test Options: + -p, --public Download dependencies from community -d, --download Download dependencies -i, --install Install dependencies -c, --clear Clear dependencies @@ -90,7 +127,7 @@ EOF } function parse_args(){ - parsed_args=$(getopt -a -o dich --long download,install,clear,help -- "$@") || { + parsed_args=$(getopt -a -o dich --long public,download,install,clear,help -- "$@") || { help exit 1 } @@ -104,6 +141,10 @@ function parse_args(){ eval set -- "$parsed_args" while true; do case "$1" in + -p | --public) + download_runs_from_community + install_deps_community + ;; -d | --download) download_runs ;;