From 27a576df94caec0adfc8020b500ff9b06047264a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sat, 4 May 2024 20:24:57 +0200 Subject: [PATCH] chore: `pkg_review()` --- .Rbuildignore | 1 + .sync/.gitignore | 1 + R/revdep.R | 20 ++++++++++++++++++++ tools/90-patch-dplyr.R | 1 + 4 files changed, 23 insertions(+) create mode 100644 R/revdep.R diff --git a/.Rbuildignore b/.Rbuildignore index a0b007ee..a3d5998a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,3 +22,4 @@ ^cran-comments\.md$ ^CRAN-SUBMISSION$ ^codecov\.yml$ +^R/revdep\.R$ diff --git a/.sync/.gitignore b/.sync/.gitignore index 47f49fd4..eb3f2e8e 100644 --- a/.sync/.gitignore +++ b/.sync/.gitignore @@ -2,4 +2,5 @@ /dplyr-revdep/ /dplyr-cloud/ /problems*/ +/cran/ *.tar.gz diff --git a/R/revdep.R b/R/revdep.R new file mode 100644 index 00000000..b249992e --- /dev/null +++ b/R/revdep.R @@ -0,0 +1,20 @@ +pkg_review <- function(pkg, pak = TRUE) { + base_path <- ".sync/cran" + fs::dir_create(base_path) + + pkg_path <- fs::path(base_path, pkg) + + if (fs::dir_exists(pkg_path)) { + system(paste0("git -C ", pkg_path, " fetch")) + system(paste0("git -C ", pkg_path, " rebase")) + } else { + system(paste0("git -C ", base_path, " clone git@github.com:cran/", pkg)) + } + + withr::local_dir(pkg_path) + system("rh") + + if (pak) { + pak::pak(pkg, dependencies = TRUE, upgrade = TRUE, ask = FALSE) + } +} diff --git a/tools/90-patch-dplyr.R b/tools/90-patch-dplyr.R index 6f2bbc6b..055decf0 100644 --- a/tools/90-patch-dplyr.R +++ b/tools/90-patch-dplyr.R @@ -33,6 +33,7 @@ forbidden <- fs::path("R", c( "overwrite.R", "qs.R", "relational-altrep-wrap.R", + "revdep.R", "restore.R", "telemetry.R", "tpch.R",