Skip to content

Commit

Permalink
Show b2 binary and source version
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Nov 28, 2024
1 parent b2e7e5c commit 14e67f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ci/common_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ if [[ "$B2_DONT_BOOTSTRAP" != "1" ]]; then
trap show_bootstrap_log ERR
# Check if b2 already exists. This would (only) happen in a caching scenario. The purpose of caching is to save time by not recompiling everything.
# The user may clear cache or delete b2 beforehand if they wish to rebuild.
if [ ! -f b2 ] || ! b2_version_output=$(./b2 --version); then
if [ ! -f b2 ]; then
${B2_WRAPPER} ./bootstrap.sh
else
b2_version_output=$(./b2 --version)
# b2 expects versions to match
engineversion=$(echo "$b2_version_output" | tr -s ' ' | cut -d' ' -f2 | cut -d'-' -f1)
enginemajorversion=$(echo "${engineversion}" | cut -d'.' -f1)
Expand All @@ -188,6 +189,11 @@ if [[ "$B2_DONT_BOOTSTRAP" != "1" ]]; then
if [[ "${enginemajorversion}" == "${coremajorversion}" ]] && [[ "${engineminorversion}" == "${coreminorversion}" ]]; then
echo "b2 already exists and has the same version number"
else
if [[ "$engineversion" =~ ^[0-9]\.[0-9]\. ]]; then
echo "b2 binary version: $enginemajorversion:$engineminorversion vs source version $coremajorversion:$coreminorversion"
else
echo "Unable to extract B2 version from $b2_version_output"
fi
${B2_WRAPPER} ./bootstrap.sh
fi
fi
Expand Down

0 comments on commit 14e67f3

Please sign in to comment.