Skip to content

Commit 80e4cae

Browse files
committed
Report total source packages installed
1 parent 5aa1d99 commit 80e4cae

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/library/utils/R/packages2.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ install.packages <-
812812
if(verbose) message(gettextf("files: %s",
813813
paste(files, collapse=", \n\t")),
814814
domain = NA)
815-
update <- cbind(update[found, , drop=FALSE], file = files)
815+
update <- cbind(update[found, , drop=FALSE], file = files, success = TRUE)
816816
if(nrow(update) > 1L) {
817817
upkgs <- unique(pkgs <- update[, 1L])
818818
DL <- .make_dependency_list(upkgs, available)
@@ -901,6 +901,7 @@ install.packages <-
901901
## Try to figure out which
902902
pkgs <- update[, 1L]
903903
tss <- sub("[.]ts$", "", dir(".", pattern = "[.]ts$"))
904+
update[, 4L] <- pkgs %in% tss
904905
failed <- pkgs[!pkgs %in% tss]
905906
for (pkg in failed) {
906907
## targets with failed dependencies are not made (even with -k)
@@ -954,6 +955,7 @@ install.packages <-
954955
status <- system2(cmd0, args, env = env,
955956
stdout = outfile, stderr = outfile,
956957
timeout = tlim)
958+
update[i, 4L] <- status == 0L
957959
## if this times out it will leave locks behind
958960
if(!quiet && keep_outputs)
959961
writeLines(readLines(outfile))
@@ -971,17 +973,18 @@ install.packages <-
971973
file.copy(outfiles, outdir, overwrite = TRUE)
972974
unlink(tmpd2, recursive = TRUE)
973975
}
974-
## Using stderr is the wish of PR#16420
975-
if(!quiet && nonlocalrepos && !is.null(tmpd) && is.null(destdir))
976-
cat("\n", gettextf("The downloaded source packages are in\n\t%s",
977-
sQuote(normalizePath(tmpd, mustWork = FALSE))),
978-
"\n", sep = "", file = stderr())
979976
## update packages.html on Unix only if .Library was installed into
980977
libs_used <- unique(update[, 2L])
981978
if(.Platform$OS.type == "unix" && .Library %in% libs_used) {
982979
message("Updating HTML index of packages in '.Library'")
983980
make.packages.html(.Library)
984981
}
982+
## Using stderr is the wish of PR#16420
983+
if(!quiet && nonlocalrepos && !is.null(tmpd) && is.null(destdir))
984+
cat("\n", gettextf("Installed %d packages in\n\t%s",
985+
sum(update[, 4L]), paste(sQuote(normalizePath(tmpd, mustWork = FALSE)), collapse = "\n\t"),
986+
"\n", sep = "", file = stderr()))
987+
985988
} else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, TRUE)
986989

987990
invisible()

0 commit comments

Comments
 (0)