account for platform when checking for existing entries

This commit is contained in:
Patrick Schratz 2024-07-30 23:18:43 +02:00
commit ff9e19b8c6
Signed by: pat-s
GPG key ID: 3C6318841EF78925
2 changed files with 7 additions and 7 deletions

View file

@ -1,7 +1,7 @@
#' @export
install_package_system_dependencies <- function(package_name,
tag,
platform = "redhat-9",
platform = platform,
local_clone_dir) {
cli::cli_alert("{.fun install_package_system_dependencies}: Cloning package {.pkg {package_name[1]}} with tag {.field {tail(tag, 1)}}.")

View file

@ -11,7 +11,7 @@ store_build_metadata <- function(
# Check if an entry with the same package_name and tag already exists
existing_entries <- dbGetQuery(con, paste0(
"SELECT * FROM single_builds WHERE package_name = '",
package_name, "' AND tag = '", tag, "'"
package_name, "' AND tag = '", tag, "' AND platform = '", platform, "'"
))
if (nrow(existing_entries) >= 1 && !force) {
@ -19,8 +19,8 @@ store_build_metadata <- function(
} else if (nrow(existing_entries) >= 1 && force) {
cli::cli_alert_info("{.fun store_build_metadata}: Force overwriting build metadata for {.pkg {package_name}} {.field {tag}} because {.code force = TRUE} was set.")
DBI::dbExecute(con, "UPDATE single_builds SET build_timestamp = $1, error_occurred = $2, error = $3 WHERE package_name = $4 and tag = $5",
params = list(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag)
DBI::dbExecute(con, "UPDATE single_builds SET build_timestamp = $1, error_occurred = $2, error = $3, platform = $4 WHERE package_name = $5 and tag = $6",
params = list(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, platform, package_name, tag)
)
} else if (nrow(existing_entries) == 0) {
cli::cli_alert("{.fun store_build_metadata}: Storing build metadata for {.pkg {package_name}} {.field {tag}}.")
@ -97,4 +97,4 @@ build_metadata_summary <- function(package_name, platform) {
# Close the SQLite connection
dbDisconnect(con)
}
}