aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2025-03-20 19:48:13 -0400
committerGitHub <noreply@github.com>2025-03-20 19:48:13 -0400
commit5da81c51855b99bc8118d15dce7b8063af8a9afe (patch)
treece785d03c64cf66c41fa8430f10dbce76810e06b
parent9a8407077c036db8d7d4cc4f790e74cbff412514 (diff)
parentedd6f8819fdfdc900cc5069665c6fac73ea14edf (diff)
downloadstasis-5da81c51855b99bc8118d15dce7b8063af8a9afe.tar.gz
Merge pull request #101 from jhunkeler/without-extras-in-spec
Without extras in spec
-rw-r--r--src/lib/delivery/delivery.c14
-rw-r--r--src/lib/delivery/delivery_install.c8
2 files changed, 9 insertions, 13 deletions
diff --git a/src/lib/delivery/delivery.c b/src/lib/delivery/delivery.c
index 7ae2b01..d480ab4 100644
--- a/src/lib/delivery/delivery.c
+++ b/src/lib/delivery/delivery.c
@@ -210,15 +210,7 @@ void delivery_defer_packages(struct Delivery *ctx, int type) {
} else {
strncpy(package_name, name, sizeof(package_name) - 1);
}
-
- char *extra_begin = strchr(package_name, '[');
- char *extra_end = NULL;
- if (extra_begin) {
- extra_end = strchr(extra_begin, ']');
- if (extra_end) {
- *extra_begin = '\0';
- }
- }
+ remove_extras(package_name);
msg(STASIS_MSG_L3, "package '%s': ", package_name);
@@ -294,10 +286,10 @@ void delivery_defer_packages(struct Delivery *ctx, int type) {
msg(STASIS_MSG_WARN | STASIS_MSG_L2, "No %s packages were filtered by test definitions\n", mode);
} else {
if (DEFER_CONDA == type) {
- strlist_free(&ctx->conda.conda_packages);
+ guard_strlist_free(&ctx->conda.conda_packages);
ctx->conda.conda_packages = strlist_copy(filtered);
} else if (DEFER_PIP == type) {
- strlist_free(&ctx->conda.pip_packages);
+ guard_strlist_free(&ctx->conda.pip_packages);
ctx->conda.pip_packages = strlist_copy(filtered);
}
}
diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c
index cf6ccaa..246c604 100644
--- a/src/lib/delivery/delivery_install.c
+++ b/src/lib/delivery/delivery_install.c
@@ -35,6 +35,7 @@ static char *have_spec_in_config(const struct Delivery *ctx, const char *name) {
} else {
strncpy(package, config_spec, sizeof(package) - 1);
}
+ remove_extras(package);
if (strncmp(package, name, strlen(package)) == 0) {
return config_spec;
}
@@ -63,7 +64,9 @@ int delivery_overlay_packages_from_env(struct Delivery *ctx, const char *env_nam
guard_free(current_env);
struct StrList *frozen_list = strlist_init();
- strlist_append_tokenize(frozen_list, freeze_output, LINE_SEP);
+ if (!isempty(freeze_output)) {
+ strlist_append_tokenize(frozen_list, freeze_output, LINE_SEP);
+ }
guard_free(freeze_output);
struct StrList *new_list = strlist_init();
@@ -221,9 +224,10 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha
if (!ctx->meta.based_on) {
strcat(cmd, " --upgrade");
}
- sprintf(cmd + strlen(cmd), " --extra-index-url 'file://%s'", ctx->storage.wheel_artifact_dir);
}
+ sprintf(cmd + strlen(cmd), " --extra-index-url 'file://%s'", ctx->storage.wheel_artifact_dir);
+
for (size_t x = 0; manifest[x] != NULL; x++) {
char *name = NULL;
for (size_t p = 0; p < strlist_count(manifest[x]); p++) {