Skip to content

Commit 9fa8e46

Browse files
committed
Report total source packages installed
1 parent 5aa1d99 commit 9fa8e46

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/library/utils/R/packages2.R

Lines changed: 11 additions & 7 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, status = "")
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[!pkgs %in% tss, 4L] <- "FAIL"
904905
failed <- pkgs[!pkgs %in% tss]
905906
for (pkg in failed) {
906907
## targets with failed dependencies are not made (even with -k)
@@ -957,10 +958,12 @@ install.packages <-
957958
## if this times out it will leave locks behind
958959
if(!quiet && keep_outputs)
959960
writeLines(readLines(outfile))
960-
if(status > 0L)
961+
if(status > 0L){
961962
warning(gettextf("installation of package %s had non-zero exit status",
962963
sQuote(update[i, 1L])),
963964
domain = NA)
965+
update[i, 4L] <- "FAIL"
966+
}
964967
else if(verbose) {
965968
cmd <- paste(c(cmd0, args), collapse = " ")
966969
message(sprintf("%d): succeeded '%s'", i, cmd),
@@ -971,17 +974,18 @@ install.packages <-
971974
file.copy(outfiles, outdir, overwrite = TRUE)
972975
unlink(tmpd2, recursive = TRUE)
973976
}
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())
979977
## update packages.html on Unix only if .Library was installed into
980978
libs_used <- unique(update[, 2L])
981979
if(.Platform$OS.type == "unix" && .Library %in% libs_used) {
982980
message("Updating HTML index of packages in '.Library'")
983981
make.packages.html(.Library)
984982
}
983+
## Using stderr is the wish of PR#16420
984+
if(!quiet && nonlocalrepos && !is.null(tmpd) && is.null(destdir))
985+
cat("\n", gettextf("Installed %d packages in\n\t%s", sum(update[, 4L] != "FAIL"),
986+
paste(sQuote(normalizePath(libs_used, mustWork = FALSE)), collapse = "\n\t")),
987+
"\n", sep = "", file = stderr())
988+
985989
} else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, TRUE)
986990

987991
invisible()

0 commit comments

Comments
 (0)