aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/core/conda.c3
-rw-r--r--src/lib/core/include/conda.h5
-rw-r--r--src/lib/delivery/delivery_conda.c2
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);
}