Skip to content

Commit 11ece68

Browse files
committed
minor change
1 parent 1a5780a commit 11ece68

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/anaconda/.devcontainer/install_vulnerable_packages.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ compare_semver() {
5555
}
5656

5757
for ((i=0; i<rows; i++)); do
58-
5958
CURRENT_VERSION=$(pip show "${packages_array[$i,0]}" | grep '^Version:' | awk '{print $2}')
59+
if [[ -z "$CURRENT_VERSION" ]]; then
60+
echo "No version for ${packages_array[$i,0]} found in upstream i.e. base image."
61+
CURRENT_VERSION="0"
62+
fi
6063
REQUIRED_VERSION="${packages_array[$i,1]}"
6164
comparison_result=$(compare_semver "${REQUIRED_VERSION}" "${CURRENT_VERSION}")
6265
# Check if the current version installed is greater or equal to the required version
@@ -71,6 +74,10 @@ for ((i=0; i<rows; i++)); do
7174
uniq | \
7275
tail -n 2 | \
7376
head -n 1)
77+
if [[ -z "$CONDA_VERSION" ]]; then
78+
echo "No version for ${packages_array[$i,0]} found in conda channel."
79+
CONDA_VERSION="0"
80+
fi
7481
comparison_result2=$(compare_semver "${REQUIRED_VERSION}" "${CONDA_VERSION}")
7582
if [[ $comparison_result2 == "lesser" ]] || [[ $comparison_result2 == "equal" ]]; then
7683
echo -e "Greater version between required version: v${REQUIRED_VERSION} and conda version: v${CONDA_VERSION} is conda version: v${CONDA_VERSION}\n";

0 commit comments

Comments
 (0)