Skip to content

Commit

Permalink
Report total source packages installed
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 21, 2025
1 parent 5aa1d99 commit 80e4cae
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/library/utils/R/packages2.R
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ install.packages <-
if(verbose) message(gettextf("files: %s",
paste(files, collapse=", \n\t")),
domain = NA)
update <- cbind(update[found, , drop=FALSE], file = files)
update <- cbind(update[found, , drop=FALSE], file = files, success = TRUE)
if(nrow(update) > 1L) {
upkgs <- unique(pkgs <- update[, 1L])
DL <- .make_dependency_list(upkgs, available)
Expand Down Expand Up @@ -901,6 +901,7 @@ install.packages <-
## Try to figure out which
pkgs <- update[, 1L]
tss <- sub("[.]ts$", "", dir(".", pattern = "[.]ts$"))
update[, 4L] <- pkgs %in% tss
failed <- pkgs[!pkgs %in% tss]
for (pkg in failed) {
## targets with failed dependencies are not made (even with -k)
Expand Down Expand Up @@ -954,6 +955,7 @@ install.packages <-
status <- system2(cmd0, args, env = env,
stdout = outfile, stderr = outfile,
timeout = tlim)
update[i, 4L] <- status == 0L
## if this times out it will leave locks behind
if(!quiet && keep_outputs)
writeLines(readLines(outfile))
Expand All @@ -971,17 +973,18 @@ install.packages <-
file.copy(outfiles, outdir, overwrite = TRUE)
unlink(tmpd2, recursive = TRUE)
}
## Using stderr is the wish of PR#16420
if(!quiet && nonlocalrepos && !is.null(tmpd) && is.null(destdir))
cat("\n", gettextf("The downloaded source packages are in\n\t%s",
sQuote(normalizePath(tmpd, mustWork = FALSE))),
"\n", sep = "", file = stderr())
## update packages.html on Unix only if .Library was installed into
libs_used <- unique(update[, 2L])
if(.Platform$OS.type == "unix" && .Library %in% libs_used) {
message("Updating HTML index of packages in '.Library'")
make.packages.html(.Library)
}
## Using stderr is the wish of PR#16420
if(!quiet && nonlocalrepos && !is.null(tmpd) && is.null(destdir))
cat("\n", gettextf("Installed %d packages in\n\t%s",
sum(update[, 4L]), paste(sQuote(normalizePath(tmpd, mustWork = FALSE)), collapse = "\n\t"),
"\n", sep = "", file = stderr()))

} else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, TRUE)

invisible()
Expand Down

0 comments on commit 80e4cae

Please sign in to comment.