Skip to content

Commit

Permalink
Improve messaging for install packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 21, 2025
1 parent 4d63f3f commit 5aa1d99
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/library/utils/R/unix/mac.install.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 4 additions & 5 deletions src/library/utils/R/windows/install.packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/internet/internet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
2 changes: 1 addition & 1 deletion src/modules/internet/libcurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5aa1d99

Please sign in to comment.