skip file move if file does not exist
This commit is contained in:
parent
0293be70ed
commit
830390dc31
1 changed files with 11 additions and 6 deletions
|
|
@ -67,7 +67,7 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
||||||
{
|
{
|
||||||
install_package_system_dependencies(package_name, tag, platform, local_clone_dir)
|
install_package_system_dependencies(package_name, tag, platform, local_clone_dir)
|
||||||
},
|
},
|
||||||
# NB: here we need to use conditionMessage() to extract the actual error - as opposed to using $stderr for errors within the tryCatch used in the future* calls
|
# NB: here we need to use conditionMessage() to extract the actual error - as opposed to using $stderr for errors within the tryCatch used in the future* calls
|
||||||
error = function(e) {
|
error = function(e) {
|
||||||
message(sprintf("Error in installing dependencies for package %s with tag %s: %s", package_name[1], tag[1], e))
|
message(sprintf("Error in installing dependencies for package %s with tag %s: %s", package_name[1], tag[1], e))
|
||||||
store_build_metadata(package_name[1], tag[1], platform, error_occurred = TRUE, force = TRUE, error = conditionMessage(e))
|
store_build_metadata(package_name[1], tag[1], platform, error_occurred = TRUE, force = TRUE, error = conditionMessage(e))
|
||||||
|
|
@ -169,11 +169,16 @@ build_single_tag <- function(
|
||||||
if (debug) {
|
if (debug) {
|
||||||
cli::cli_alert_info('{.fun build_single_tag}: Moving package from {.path {sprintf("%s/%s_%s_R_aarch64-unknown-linux-gnu.tar.gz", dir_out_bin, package_name, tag))}} to {.path {sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag)}}')
|
cli::cli_alert_info('{.fun build_single_tag}: Moving package from {.path {sprintf("%s/%s_%s_R_aarch64-unknown-linux-gnu.tar.gz", dir_out_bin, package_name, tag))}} to {.path {sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag)}}')
|
||||||
}
|
}
|
||||||
# remove _aarch64-unknown-linux-gnu part in filename
|
# double-check that file exists (some packages like https://github.com/cran/BACCO/tree/1.0-14 don't include R/ and hence don't procude a valid binary)
|
||||||
fs::file_move(
|
if (fs::file_exists(sprintf("%s/%s_%s_R_aarch64-unknown-linux-gnu.tar.gz", dir_out_bin, package_name, tag))) {
|
||||||
sprintf("%s/%s_%s_R_aarch64-unknown-linux-gnu.tar.gz", dir_out_bin, package_name, tag),
|
# remove _aarch64-unknown-linux-gnu part in filename
|
||||||
sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag)
|
fs::file_move(
|
||||||
)
|
sprintf("%s/%s_%s_R_aarch64-unknown-linux-gnu.tar.gz", dir_out_bin, package_name, tag),
|
||||||
|
sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
cli::cli_alert_info('{.fun build_single_tag}: File for package {.pkg {package_name}} {.field {tag}} at {.path {sprintf("%s/%s_%s_R_aarch64-unknown-linux-gnu.tar.gz", dir_out_bin, package_name, tag))}} does not exist - skipping.')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cli::cli_alert_warning('{.fun build_single_tag}: Binary {sprintf("%s_%s.tar.gz", package_name, tag)} already exists. Skipping copy.')
|
cli::cli_alert_warning('{.fun build_single_tag}: Binary {sprintf("%s_%s.tar.gz", package_name, tag)} already exists. Skipping copy.')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue