File tree Expand file tree Collapse file tree 3 files changed +47
-7
lines changed
Expand file tree Collapse file tree 3 files changed +47
-7
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,7 @@ if [ ! -f $DEPS_INSTALL_RUNTIME_DIR/odb-install/bin/odb ]; then
138138 if [[ $ODB_VERSION == " 2.5.0" ]]; then
139139 # build2
140140 cd $PACKAGES_DIR
141- wget --no-verbose --no-clobber https://download.build2.org/0.16.0/build2-install-0.16.0.sh
142- sh build2-install-0.16.0.sh --yes --trust yes --jobs $( nproc) $PACKAGES_DIR /build2-install
141+ sh $CI_PROJECT_DIR /scripts/install_latest_build2.sh $PACKAGES_DIR /build2-install
143142 export PATH=$PACKAGES_DIR /build2-install/bin:$PATH
144143
145144 # odb, libodb
@@ -160,9 +159,6 @@ if [ ! -f $DEPS_INSTALL_RUNTIME_DIR/odb-install/bin/odb ]; then
160159 bpkg build libodb-sqlite --yes --quiet --jobs $( nproc)
161160 bpkg build libodb-pgsql --yes --quiet --jobs $( nproc)
162161 bpkg install --all --recursive --quiet --jobs $( nproc)
163-
164- rm -f $PACKAGES_DIR /build2-toolchain-0.16.0.tar.xz
165- rm -f $PACKAGES_DIR /build2-install-0.16.0.sh
166162 elif [[ $ODB_VERSION == " 2.4.0" ]]; then
167163 # odb
168164 cd $PACKAGES_DIR
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ The ODB installation uses the build2 build system. (Build2 is not needed for
120120CodeCompass so you may delete it right after the installation of ODB.)
121121
122122``` bash
123- wget https://download.build2.org/0.16.0/build2-install-0.16.0 .sh
124- sh build2-install-0.16.0.sh --yes --trust yes " <build2_install_dir>"
123+ wget https://github.com/Ericsson/CodeCompass/blob/master/scripts/install_latest_build2 .sh
124+ sh install_latest_build2.sh " <build2_install_dir>"
125125```
126126
127127Now, utilizing the * Build2* toolchain, we can build the * ODB* compiler and
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ $# -lt 1 ]; then
4+ echo " No installation directory was provided for build2!" 1>&2
5+ exit 1
6+ fi
7+
8+ # # download phase
9+
10+ install_dir=$1
11+ toolchain_file=" toolchain.sha256"
12+ wget --no-verbose --no-clobber https://download.build2.org/toolchain.sha256 -O " ${toolchain_file} "
13+
14+ version_line=$( grep -m 1 ' ' " $toolchain_file " )
15+ version_number=$( echo " $version_line " | awk ' {print $2}' )
16+ version_to_install=build2-install-${version_number} .sh
17+ download_url=https://download.build2.org/${version_number} /${version_to_install}
18+ wget --no-verbose --no-clobber " ${download_url} " -O " ${version_to_install} "
19+
20+ # # sha256 check phase
21+
22+ line_with_version=$( grep " $version_to_install " " $toolchain_file " )
23+ checksum_for_version=$( echo " $line_with_version " | awk ' {print $1}' )
24+
25+ if echo " ${checksum_for_version} ${version_to_install} " | sha256sum -c; then
26+ echo " Build2 installer for version ${version_number} has been downloaded!"
27+ else
28+ echo " Expected checksum for build2 installer version ${version_number} doesn't match! Probably the file has been corrupted! Please install it manually!" 1>&2
29+ echo " Expected: ${checksum_for_version} " 1>&2
30+ rm " $version_to_install " " $toolchain_file "
31+ exit 1
32+ fi
33+
34+ # # install phase
35+
36+ sh ${version_to_install} --yes --trust yes --jobs $( nproc) " ${install_dir} "
37+
38+ # # cleanup phase
39+
40+ compressed_toolchain=" build2-toolchain-${version_number} .tar.xz"
41+
42+ rm -f " ${toolchain_file} " " ${version_to_install} " " ${compressed_toolchain} "
43+
44+ echo " Build2 version ${version_number} has been successfully installed!"
You can’t perform that action at this time.
0 commit comments