diff --git a/src/library/utils/R/packages2.R b/src/library/utils/R/packages2.R index 32c2b0926ca..93250fa940d 100644 --- a/src/library/utils/R/packages2.R +++ b/src/library/utils/R/packages2.R @@ -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, status = "") if(nrow(update) > 1L) { upkgs <- unique(pkgs <- update[, 1L]) DL <- .make_dependency_list(upkgs, available) @@ -901,6 +901,7 @@ install.packages <- ## Try to figure out which pkgs <- update[, 1L] tss <- sub("[.]ts$", "", dir(".", pattern = "[.]ts$")) + update[!pkgs %in% tss, 4L] <- "FAIL" failed <- pkgs[!pkgs %in% tss] for (pkg in failed) { ## targets with failed dependencies are not made (even with -k) @@ -957,10 +958,12 @@ install.packages <- ## if this times out it will leave locks behind if(!quiet && keep_outputs) writeLines(readLines(outfile)) - if(status > 0L) + if(status > 0L){ warning(gettextf("installation of package %s had non-zero exit status", sQuote(update[i, 1L])), domain = NA) + update[i, 4L] <- "FAIL" + } else if(verbose) { cmd <- paste(c(cmd0, args), collapse = " ") message(sprintf("%d): succeeded '%s'", i, cmd), @@ -971,17 +974,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] != "FAIL"), + paste(sQuote(normalizePath(libs_used, mustWork = FALSE)), collapse = "\n\t")), + "\n", sep = "", file = stderr()) + } else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, TRUE) invisible() diff --git a/src/library/utils/R/unix/mac.install.R b/src/library/utils/R/unix/mac.install.R index b5b4bd8a028..4e03bc12c34 100644 --- a/src/library/utils/R/unix/mac.install.R +++ b/src/library/utils/R/unix/mac.install.R @@ -179,10 +179,11 @@ if(!startsWith(R.version$os, "darwin")) { unpackPkg(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, lock = lock) } + if(!quiet && sum(oklib)){ + cat("\n", gettextf("Successfully installed %d binary packages in\n\t%s", + sum(oklib), lib), "\n", sep = "") + } } - if(!quiet && !is.null(tmpd) && is.null(destdir)) - cat("\n", gettextf("The downloaded binary packages are in\n\t%s", tmpd), - "\n", sep = "") } else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, recursive = TRUE) invisible() diff --git a/src/library/utils/R/windows/install.packages.R b/src/library/utils/R/windows/install.packages.R index 0f606598eb7..6d66baf54f3 100644 --- a/src/library/utils/R/windows/install.packages.R +++ b/src/library/utils/R/windows/install.packages.R @@ -274,12 +274,11 @@ unpackPkgZip <- function(pkg, pkgname, lib, libs_only = FALSE, unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, libs_only, lock) } + if(!quiet && sum(oklib)){ + cat("\n", gettextf("Successfully installed %d binary packages in\n\t%s", + sum(oklib), normalizePath(lib, mustWork = FALSE)), "\n", sep = "") + } } - if(!quiet && !is.null(tmpd) && is.null(destdir)) - ## tends to be a long path on Windows - cat("\n", gettextf("The downloaded binary packages are in\n\t%s", - normalizePath(tmpd, mustWork = FALSE)), - "\n", sep = "") } else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, recursive = TRUE) invisible() diff --git a/src/modules/internet/internet.c b/src/modules/internet/internet.c index e3871379a68..492f42a679c 100644 --- a/src/modules/internet/internet.c +++ b/src/modules/internet/internet.c @@ -417,7 +417,7 @@ static SEXP in_do_download(SEXP args) } R_Busy(1); - if(!quiet) REprintf(_("trying URL '%s'\n"), url); + if(!quiet) REprintf(_("Downloading '%s'\n"), url); SEXP agentFun, sagent; R_FlushConsole(); agentFun = PROTECT(lang2(install("makeUserAgent"), ScalarLogical(0))); diff --git a/src/modules/internet/libcurl.c b/src/modules/internet/libcurl.c index 0741b07c4a4..abd4acfd7d3 100644 --- a/src/modules/internet/libcurl.c +++ b/src/modules/internet/libcurl.c @@ -787,7 +787,7 @@ static int download_add_url(int i, SEXP scmd, const char *mode, curl_easy_setopt(hnd[i], CURLOPT_ACCEPT_ENCODING, "gzip, deflate"); */ - if (!quiet) REprintf(_("trying URL '%s'\n"), url); + if (!quiet) REprintf(_("Downloading '%s'\n"), url); vmaxset(vmax); return 0; }