Skip to content

Commit e100545

Browse files
committed
Improve messaging for install packages
1 parent 4d63f3f commit e100545

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/library/utils/R/unix/mac.install.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,13 @@ if(!startsWith(R.version$os, "darwin")) {
179179
unpackPkg(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib,
180180
lock = lock)
181181
}
182+
if(!quiet && sum(oklib)){
183+
cat("\n", gettextf("Successfully installed %d binary packages in\n\t%s",
184+
sum(oklib), lib), "\n", sep = "")
185+
}
182186
}
183187
if(!quiet && !is.null(tmpd) && is.null(destdir))
184-
cat("\n", gettextf("The downloaded binary packages are in\n\t%s", tmpd),
185-
"\n", sep = "")
188+
186189
} else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, recursive = TRUE)
187190

188191
invisible()

src/library/utils/R/windows/install.packages.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,11 @@ unpackPkgZip <- function(pkg, pkgname, lib, libs_only = FALSE,
274274
unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L],
275275
lib, libs_only, lock)
276276
}
277+
if(!quiet && sum(oklib)){
278+
cat("\n", gettextf("Successfully installed %d binary packages in\n\t%s",
279+
sum(oklib), normalizePath(lib, mustWork = FALSE)), "\n", sep = "")
280+
}
277281
}
278-
if(!quiet && !is.null(tmpd) && is.null(destdir))
279-
## tends to be a long path on Windows
280-
cat("\n", gettextf("The downloaded binary packages are in\n\t%s",
281-
normalizePath(tmpd, mustWork = FALSE)),
282-
"\n", sep = "")
283282
} else if(!is.null(tmpd) && is.null(destdir)) unlink(tmpd, recursive = TRUE)
284283

285284
invisible()

src/modules/internet/internet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static SEXP in_do_download(SEXP args)
417417
}
418418

419419
R_Busy(1);
420-
if(!quiet) REprintf(_("trying URL '%s'\n"), url);
420+
if(!quiet) REprintf(_("Downloading '%s'\n"), url);
421421
SEXP agentFun, sagent;
422422
R_FlushConsole();
423423
agentFun = PROTECT(lang2(install("makeUserAgent"), ScalarLogical(0)));

src/modules/internet/libcurl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ static int download_add_url(int i, SEXP scmd, const char *mode,
787787
curl_easy_setopt(hnd[i], CURLOPT_ACCEPT_ENCODING, "gzip, deflate");
788788
*/
789789

790-
if (!quiet) REprintf(_("trying URL '%s'\n"), url);
790+
if (!quiet) REprintf(_("Downloading '%s'\n"), url);
791791
vmaxset(vmax);
792792
return 0;
793793
}

0 commit comments

Comments
 (0)