From cb8aeff9453acec878e5ab8515cda0d302c943eb Mon Sep 17 00:00:00 2001 From: mattdowle Date: Sun, 20 Nov 2022 15:20:42 -0700 Subject: [PATCH] .dev-only: revdep faster startup as one part was too deep in a loop, and no need to update.packages() a 2nd time --- .dev/revdep.R | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.dev/revdep.R b/.dev/revdep.R index c1ab9b0f3..0b949da36 100644 --- a/.dev/revdep.R +++ b/.dev/revdep.R @@ -155,7 +155,6 @@ for (p in deps) { } } cat("New downloaded:",new," Already had latest:", old, " TOTAL:", length(deps), "\n") -update.packages(checkBuilt=TRUE, ask=FALSE) # won't rebuild packages which are no longer available on CRAN # Remove the tar.gz no longer needed : for (p in deps) { @@ -166,12 +165,12 @@ for (p in deps) { cat("Removing",i,"because",f,"is newer\n") system(paste0("rm ",i)) } - all = system("ls *.tar.gz", intern=TRUE) - all = sapply(strsplit(all, split="_"),'[',1) - for (i in all[!all %in% deps]) { - cat("Removing",i,"because it", if (!i %in% rownames(avail)) "has been removed from CRAN\n" else "no longer uses data.table\n") - system(paste0("rm ",i,"_*.tar.gz")) - } +} +all = system("ls *.tar.gz", intern=TRUE) +all = sapply(strsplit(all, split="_"),'[',1) +for (i in all[!all %in% deps]) { + cat("Removing",i,"because it", if (!i %in% rownames(avail)) "has been removed from CRAN\n" else "no longer uses data.table\n") + system(paste0("rm ",i,"_*.tar.gz")) } num_tar.gz = as.integer(system("ls *.tar.gz | wc -l", intern=TRUE)) if (length(deps) != num_tar.gz) stop("num_tar.gz==",num_tar.gz," but length(deps)==",length(deps))