Skip to content

Commit 0a64f2f

Browse files
committed
Report how far through the package update process we are
1 parent 01bc79a commit 0a64f2f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mirror-updater/git_update_functions.R

+7-4
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ updateRepositories <- function(repo_dir, manifest, update_all = FALSE) {
283283
} else {
284284
extra <- ifelse(length(pkgs) > 10, paste("+", length(pkgs) - 10, "more"), "")
285285
printMessage(paste("Updating:", paste(c(head(pkgs, 10), extra), collapse = ", ")), 2)
286-
for(pkg in pkgs) {
287-
printMessage(paste0("Package: ", pkg), 0)
286+
skipped_pkgs <- NULL
287+
for(i in seq_along(pkgs)) {
288+
pkg <- pkgs[i]
289+
printMessage(sprintf("Package: %s (%i of %i)", pkg, i, length(pkgs)), 0)
288290
repo <- file.path(repo_dir, pkg)
289291

290292
if(!dir.exists(repo)) {
@@ -296,7 +298,7 @@ updateRepositories <- function(repo_dir, manifest, update_all = FALSE) {
296298
return(TRUE)
297299
})
298300
if(isTRUE(skip)) {
299-
pkgs <- setdiff(pkgs, pkg)
301+
skipped_pkgs <- c(skipped_pkgs, pkg)
300302
} else {
301303
checkoutBranches(pkg, repo_dir = repo_dir)
302304
}
@@ -309,11 +311,12 @@ updateRepositories <- function(repo_dir, manifest, update_all = FALSE) {
309311
0, timestamp = TRUE)
310312
return(TRUE)
311313
})
312-
if(isTRUE(skip)) { pkgs <- setdiff(pkgs, pkg) }
314+
if(isTRUE(skip)) { skipped_pkgs <- c(skipped_pkgs, pkg) }
313315

314316
}
315317

316318
}
319+
pkgs <- setdiff(pkgs, skipped_pkgs)
317320
printMessage("Finished updating repositories", 0)
318321
return(pkgs)
319322
}

0 commit comments

Comments
 (0)