Skip to content

Commit

Permalink
fix(codechecker): Do not install "alpha" or "rc" versions when auto-s…
Browse files Browse the repository at this point in the history
…electing
  • Loading branch information
whisperity committed Dec 21, 2022
1 parent 3cf8e7d commit 403b613
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/build-codechecker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
set -e

set -eo pipefail
if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then
set -x
fi
Expand Down
1 change: 1 addition & 0 deletions src/get-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e
if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then
set -x
fi
set -u

echo "::group::Installing LLVM"

Expand Down
30 changes: 25 additions & 5 deletions src/pip-codechecker.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
#!/bin/bash
set -o pipefail
if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then
set -x
fi

echo "::group::Installing CodeChecker from PyPI"
echo "::group::Installing CodeChecker $IN_VERSION from PyPI"
if [[ "$IN_VERSION" == "master" ]]; then
# The default branch name "master" is offered as a convenient shortcut for
# fetching the latest release.
pip3 install codechecker
else
pip3 install codechecker=="$IN_VERSION"
# fetching the latest release. Unfortunately, this might just be a release
# candidate, which we do not wish to supply to automated production users
# this eagerly...

# Hack to get pip list us which versions are available...
# (thanks, http://stackoverflow.com/a/26664162)
pip3 install codechecker=="You_cant_be_serious_mate" 2>&1 \
| grep "ERROR: Could not find a version" \
| sed 's/^.*(from versions: \(.*\))/\1/' \
| sed 's/, /\n/g' \
| grep -v 'rc\|a' \
| sort -V \
| tail -n 1 \
>> "codechecker_latest_release.txt"

IN_VERSION=$(cat "codechecker_latest_release.txt")
echo "Selected CodeChecker version $IN_VERSION automatically."
rm "codechecker_latest_release.txt"
fi

set -e

pip3 install codechecker=="$IN_VERSION"

pip3 show codechecker
echo "::endgroup::"

Expand Down

0 comments on commit 403b613

Please sign in to comment.