Skip to content

Commit 403b613

Browse files
committed
fix(codechecker): Do not install "alpha" or "rc" versions when auto-selecting
1 parent 3cf8e7d commit 403b613

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

src/build-codechecker.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
2-
set -e
3-
2+
set -eo pipefail
43
if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then
54
set -x
65
fi

src/get-llvm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -e
33
if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then
44
set -x
55
fi
6+
set -u
67

78
echo "::group::Installing LLVM"
89

src/pip-codechecker.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
#!/bin/bash
2+
set -o pipefail
23
if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then
34
set -x
45
fi
56

6-
echo "::group::Installing CodeChecker from PyPI"
7+
echo "::group::Installing CodeChecker $IN_VERSION from PyPI"
78
if [[ "$IN_VERSION" == "master" ]]; then
89
# The default branch name "master" is offered as a convenient shortcut for
9-
# fetching the latest release.
10-
pip3 install codechecker
11-
else
12-
pip3 install codechecker=="$IN_VERSION"
10+
# fetching the latest release. Unfortunately, this might just be a release
11+
# candidate, which we do not wish to supply to automated production users
12+
# this eagerly...
13+
14+
# Hack to get pip list us which versions are available...
15+
# (thanks, http://stackoverflow.com/a/26664162)
16+
pip3 install codechecker=="You_cant_be_serious_mate" 2>&1 \
17+
| grep "ERROR: Could not find a version" \
18+
| sed 's/^.*(from versions: \(.*\))/\1/' \
19+
| sed 's/, /\n/g' \
20+
| grep -v 'rc\|a' \
21+
| sort -V \
22+
| tail -n 1 \
23+
>> "codechecker_latest_release.txt"
24+
25+
IN_VERSION=$(cat "codechecker_latest_release.txt")
26+
echo "Selected CodeChecker version $IN_VERSION automatically."
27+
rm "codechecker_latest_release.txt"
1328
fi
29+
30+
set -e
31+
32+
pip3 install codechecker=="$IN_VERSION"
33+
1434
pip3 show codechecker
1535
echo "::endgroup::"
1636

0 commit comments

Comments
 (0)