aboutsummaryrefslogtreecommitdiff
path: root/src/delivery_install.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2024-10-04 16:12:26 -0400
committerGitHub <noreply@github.com>2024-10-04 16:12:26 -0400
commit70f76b377e2d35fa097b65a82fc7cac4f5f172d4 (patch)
tree7ff5169c28b1c14d91ab00452806a087d1562690 /src/delivery_install.c
parent6e72330a3cc8d571b14f2234ed8fc2778b5e9b86 (diff)
parentbf1ecd2deb3c2d777efe93c0da6212bdbcc2240e (diff)
downloadstasis-70f76b377e2d35fa097b65a82fc7cac4f5f172d4.tar.gz
Merge pull request #51 from jhunkeler/wheel-funcs-clean-up
Clean up get_wheel_info
Diffstat (limited to 'src/delivery_install.c')
-rw-r--r--src/delivery_install.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/delivery_install.c b/src/delivery_install.c
index 72f2663..6f745a7 100644
--- a/src/delivery_install.c
+++ b/src/delivery_install.c
@@ -82,18 +82,29 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha
// We can't match on version here (index 0). The wheel's version is not guaranteed to be
// equal to the tag; setuptools_scm auto-increments the value, the user can change it manually,
// etc.
- whl = get_wheel_file(ctx->storage.wheel_artifact_dir, info->name,
+ errno = 0;
+ whl = get_wheel_info(ctx->storage.wheel_artifact_dir, info->name,
(char *[]) {ctx->meta.python_compact, ctx->system.arch,
"none", "any",
post_commit, hash,
NULL}, WHEEL_MATCH_ANY);
-
- guard_strlist_free(&tag_data);
- info->version = whl->version;
- sprintf(cmd + strlen(cmd), " '%s==%s'", info->name, whl->version);
- } else {
- sprintf(cmd + strlen(cmd), " '%s==%s'", info->name, info->version);
+ if (!whl && errno) {
+ // error
+ SYSERROR("Unable to read Python wheel info: %s\n", strerror(errno));
+ exit(1);
+ } else if (!whl) {
+ // not found
+ fprintf(stderr, "No wheel packages found that match the description of '%s'", info->name);
+ } else {
+ // found
+ guard_strlist_free(&tag_data);
+ info->version = strdup(whl->version);
+ }
+ wheel_free(&whl);
}
+ snprintf(cmd + strlen(cmd),
+ sizeof(cmd) - strlen(cmd) - strlen(info->name) - strlen(info->version) + 5,
+ " '%s==%s'", info->name, info->version);
} else {
fprintf(stderr, "Deferred package '%s' is not present in the tested package list!\n", name);
return -1;