Skip to content

Commit bbbb460

Browse files
Copilotabdurriq
andcommitted
Fix version matching for specific conda versions - handle version suffixes
Co-authored-by: abdurriq <137001048+abdurriq@users.noreply.github.com>
1 parent 57c7a77 commit bbbb460

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/conda/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "conda",
3-
"version": "1.2.4",
3+
"version": "1.2.5",
44
"name": "Conda",
55
"description": "A cross-platform, language-agnostic binary package manager",
66
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/conda",

src/conda/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ if ! conda --version &> /dev/null ; then
103103
else
104104
# For specific versions, query the Packages file to find the exact filename
105105
echo "Fetching package list to find version ${VERSION}..."
106-
CONDA_PKG_INFO=$(curl -fsSL "${PACKAGES_URL}" | grep -B 5 "^Version: ${VERSION}" | grep -A 30 "^Package: conda$" | head -n 31)
106+
# Search for version pattern - user may specify 4.12.0 but package has 4.12.0-0
107+
CONDA_PKG_INFO=$(curl -fsSL "${PACKAGES_URL}" | grep -A 30 "^Package: conda$" | grep -B 5 -A 25 "^Version: ${VERSION}")
107108
CONDA_FILENAME=$(echo "${CONDA_PKG_INFO}" | grep "^Filename:" | head -n 1 | awk '{print $2}')
108109

109110
if [ -z "${CONDA_FILENAME}" ]; then

0 commit comments

Comments
 (0)