@@ -71,11 +71,9 @@ cd "${BUILDDIR}"
7171case " ${with_cmake} " in
7272 __INSTALL__)
7373 echo " ==================== Installing CMake ===================="
74- cmake_ext=" sh"
7574 if [ " ${OPENBLAS_ARCH} " = " arm64" ]; then
7675 if [ " $( uname -s) " = " Darwin" ]; then
7776 cmake_arch=" macos-universal"
78- cmake_ext=" tar.gz"
7977 elif [ " $( uname -s) " = " Linux" ]; then
8078 cmake_arch=" linux-aarch64"
8179 else
@@ -92,28 +90,24 @@ case "${with_cmake}" in
9290 pkg_install_dir=" ${INSTALLDIR} /cmake-${cmake_ver} "
9391 # pkg_install_dir="${HOME}/apps/cmake/${cmake_ver}"
9492 install_lock_file=" ${pkg_install_dir} /install_successful"
95- cmake_pkg=" cmake-${cmake_ver} -${cmake_arch} .${cmake_ext} "
93+ cmake_pkg=" cmake-${cmake_ver} -${cmake_arch} .tar.gz "
9694 if verify_checksums " ${install_lock_file} " ; then
9795 echo " cmake-${cmake_ver} is already installed, skipping it."
9896 else
99- if [ -f $cmake_pkg ]; then
100- echo " $cmake_pkg is found"
101- else
102- # download_pkg_from_ABACUS_org "${cmake_sha256}" "$cmake_pkg"
103- url=" https://cmake.org/files/v${cmake_ver% .* } /${cmake_pkg} "
104- download_pkg_from_url " ${cmake_sha256} " " ${cmake_pkg} " " ${url} "
105- fi
97+ url=" https://cmake.org/files/v${cmake_ver% .* } /${cmake_pkg} "
98+ retrieve_package " ${cmake_sha256} " " ${cmake_pkg} " " ${url} "
10699 if [ " ${PACK_RUN} " = " __TRUE__" ]; then
107100 echo " --pack-run mode specified, skip installation"
108101 exit 0
109102 fi
110103 echo " Installing from scratch into ${pkg_install_dir} "
111104 mkdir -p ${pkg_install_dir}
112105 if [ " ${cmake_arch} " = " macos-universal" ]; then
113- tar --strip-components=3 -xvf $cmake_pkg -C ${pkg_install_dir} > install.log 2>&1 || tail -n ${LOG_LINES} install.log
106+ strip_components=3
114107 else
115- /bin/sh $cmake_pkg --prefix= ${pkg_install_dir} --skip-license > install.log 2>&1 || tail -n ${LOG_LINES} install.log
108+ strip_components=1
116109 fi
110+ tar --strip-components=${strip_components} -xvf ${cmake_pkg} -C ${pkg_install_dir} > install.log 2>&1 || tail_excerpt install.log
117111 write_checksums " ${install_lock_file} " " ${SCRIPT_DIR} /stage0/$( basename ${SCRIPT_NAME} ) "
118112 fi
119113 ;;
0 commit comments