diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 18:38:55 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 18:55:49 -0400 |
commit | f46098c9d4444d38ae0a423b8de6e6c68adb2e54 (patch) | |
tree | 0e49f696ca4fbb9b54f7de4da30f843bad074c95 | |
parent | 160beb9a7537d94a8e7d405ff08055c82743ff21 (diff) | |
download | stasis-f46098c9d4444d38ae0a423b8de6e6c68adb2e54.tar.gz |
When a wheel doesn't exist at the destination directory, move it there. Otherwise, overwrite it with latest build
-rw-r--r-- | src/deliverable.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/deliverable.c b/src/deliverable.c index 4e20943..1da66b0 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -1139,7 +1139,12 @@ int delivery_index_wheel_artifacts(struct Delivery *ctx) { char path_src[PATH_MAX]; sprintf(path_src, "%s/%s", ctx->storage.wheel_artifact_dir, rec->d_name); - rename(path_src, path_dest); + if (access(path_dest, F_OK)) { + rename(path_src, path_dest); + } else { + copy2(path_src, path_dest, CT_PERM); + remove(path_src); + } } closedir(dp); return 0; |