diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-16 11:37:28 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-22 11:57:05 -0400 |
| commit | 4798135aec35ef84baa43dcc38a3681e490c6c78 (patch) | |
| tree | f523026daaa063a80b251c96369fcc25b7bd44cb /src | |
| parent | e0409d8c2b1160bd1f8b2b29ae18775f81dcab7c (diff) | |
| download | stasis-4798135aec35ef84baa43dcc38a3681e490c6c78.tar.gz | |
Store conda installation prefix in capabilities structure
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/core/conda.c | 3 | ||||
| -rw-r--r-- | src/lib/core/include/conda.h | 5 | ||||
| -rw-r--r-- | src/lib/delivery/delivery_conda.c | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c index a95b420..b1d4cc2 100644 --- a/src/lib/core/conda.c +++ b/src/lib/core/conda.c @@ -802,7 +802,7 @@ void conda_capable_free(struct CondaCapabilities *ccap) { memset(ccap, 0, sizeof(*ccap)); } -int conda_capable(struct CondaCapabilities *ccap) { +int conda_capable(struct CondaCapabilities *ccap, const char *root) { struct CondaCapabilities *cc = ccap; memset(cc, 0, sizeof(*cc)); @@ -824,6 +824,7 @@ int conda_capable(struct CondaCapabilities *ccap) { return -1; } + cc->prefix = root; cc->conda_version = strdup(conda_version); cc->mamba_version = strdup(mamba_version); if (version_compare(GT | EQ, cc->conda_version, "25.3.0")) { diff --git a/src/lib/core/include/conda.h b/src/lib/core/include/conda.h index 3e79b69..9a6178b 100644 --- a/src/lib/core/include/conda.h +++ b/src/lib/core/include/conda.h @@ -32,6 +32,8 @@ * @see implementation in `conda_capable` */ struct CondaCapabilities { + /// Conda installation prefix + const char *prefix; /// Currently installed version of Conda char *conda_version; /// Currently installed version of Mamba @@ -55,9 +57,10 @@ struct CondaCapabilities { /** * Check for the existence of "Conda" and set flags based on the availability of features * @param ccap a pointer to an empty `struct CondaCapabilities` + * @param root conda installation root directory * @return 0 on success */ -int conda_capable(struct CondaCapabilities *ccap); +int conda_capable(struct CondaCapabilities *ccap, const char *root); /** * Free memory allocated by `conda_capable` diff --git a/src/lib/delivery/delivery_conda.c b/src/lib/delivery/delivery_conda.c index e879d1d..12eddb7 100644 --- a/src/lib/delivery/delivery_conda.c +++ b/src/lib/delivery/delivery_conda.c @@ -146,7 +146,7 @@ void delivery_conda_enable(struct Delivery *ctx, char *conda_install_dir) { guard_free(conda_version); } - if (conda_capable(&ctx->conda.capabilities)) { + if (conda_capable(&ctx->conda.capabilities, ctx->storage.conda_install_prefix)) { SYSERROR("Conda capability check failed"); exit(1); } |
