aboutsummaryrefslogtreecommitdiff
path: root/src/lib/delivery
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-07-06 19:53:58 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-07-07 11:03:46 -0400
commit15c1c3d905dfbb46bac2f69ff0f4a0e93518b405 (patch)
tree6fdff91e3fbb2e4fa9b6ee4daf807f1f0e9984d9 /src/lib/delivery
parente0af29923e93a05649ae80c2bcbc3a50ed6c7243 (diff)
downloadstasis-15c1c3d905dfbb46bac2f69ff0f4a0e93518b405.tar.gz
Replace duplicate VCS version check code with delivery_autoresolve_vcs_urls() call
Diffstat (limited to 'src/lib/delivery')
-rw-r--r--src/lib/delivery/delivery_build.c18
-rw-r--r--src/lib/delivery/delivery_test.c64
2 files changed, 2 insertions, 80 deletions
diff --git a/src/lib/delivery/delivery_build.c b/src/lib/delivery/delivery_build.c
index 74ea77d..82c7824 100644
--- a/src/lib/delivery/delivery_build.c
+++ b/src/lib/delivery/delivery_build.c
@@ -448,23 +448,7 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) {
memset(dname, 0, sizeof(dname));
memset(outdir, 0, sizeof(outdir));
- const int dep_status = check_python_package_dependencies(".", NULL, NULL);
- if (dep_status) {
- const char *warning_message = "Please replace all occurrences above with standard package specs:\n"
- "\n"
- " package==x.y.z\n"
- " package>=x.y.z\n"
- " package<=x.y.z\n"
- " ...\n"
- "\n";
- if (globals.force_repeatable) {
- SYSWARN("--force-repeatable is enabled");
- SYSWARN(warning_message);
- } else {
- SYSERROR(warning_message);
- COE_CHECK_ABORT(true, "Unreproducible delivery");
- }
- }
+ delivery_autoresolve_vcs_urls(".");
safe_strncpy(dname, ctx->tests->test[i]->name, sizeof(dname));
tolower_s(dname);
diff --git a/src/lib/delivery/delivery_test.c b/src/lib/delivery/delivery_test.c
index f8da208..d3f7a17 100644
--- a/src/lib/delivery/delivery_test.c
+++ b/src/lib/delivery/delivery_test.c
@@ -178,69 +178,7 @@ void delivery_tests_run(struct Delivery *ctx) {
if (pushd(destdir)) {
COE_CHECK_ABORT(1, "Unable to enter repository directory");
} else {
- struct StrList *setup_files = strlist_init();
- if (!setup_files) {
- SYSERROR("unable to to allocate bytes for setup file list");
- exit(1);
- }
-
- struct StrList *matches = strlist_init();
- if (!matches) {
- SYSERROR("unable to allocate bytes for matches list");
- guard_strlist_free(&setup_files);
- exit(1);
- }
-
- const int dep_status = check_python_package_dependencies(".", &setup_files, &matches);
- if (dep_status) {
- const char *warning_message = "Please replace all occurrences above with standard package specs:\n"
- "\n"
- " package==x.y.z\n"
- " package>=x.y.z\n"
- " package<=x.y.z\n"
- " ...\n"
- "\n";
- if (globals.force_repeatable) {
- SYSWARN("--force-repeatable is enabled");
- SYSWARN(warning_message);
- } else {
- SYSERROR(warning_message);
- COE_CHECK_ABORT(true, "Unreproducible delivery");
- }
-
- // VCS records have been found, force_repeatable or COE is enabled, so we don't care about integrity
- // Replace the records in the file(s)
- if (strlist_count(setup_files) && strlist_count(matches)) {
- SYSDEBUG("Will replace %zu string(s) in %zu file(s)...", strlist_count(matches), strlist_count(setup_files));
- for (size_t f = 0; f < strlist_count(setup_files); f++) {
- const char *setup_file = strlist_item(setup_files, f);
- for (size_t m = 0; m < strlist_count(matches); m++) {
- const char *match = strlist_item(matches, m);
-
- // copy the original match string
- char *replacement = strdup(match);
- if (!replacement) {
- SYSERROR("unable to allocate bytes for replacement value");
- exit(1);
- }
-
- // Truncate the replacement string at the first space character or @ symbol
- char *stop = strpbrk(replacement, " @");
- if (stop) {
- *stop = '\0';
- SYSINFO("%s: replacing '%s' with '%s'", setup_file, match, replacement);
- if (file_replace_text(setup_file, match, replacement, 0)) {
- SYSERROR("%s: replacement failed", setup_file);
- exit(1);
- }
- }
- guard_free(replacement);
- }
- }
- }
- }
- guard_strlist_free(&setup_files);
- guard_strlist_free(&matches);
+ delivery_autoresolve_vcs_urls(".");
char *cmd = calloc(strlen(test->script) + STASIS_BUFSIZ, sizeof(*cmd));
if (!cmd) {