update local/ scripts
This commit is contained in:
parent
fcf2b3fed2
commit
2588b2512f
1 changed files with 130 additions and 106 deletions
25
local/label-removed-cran-packages.R
Normal file
25
local/label-removed-cran-packages.R
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
### Scope: List decomisisoned CRAN packages and updates them in the metadata DB
|
||||
archived <- quickcode::archivedPkg() |>
|
||||
filter(arch.status == "decom") |>
|
||||
pull(name)
|
||||
|
||||
# Query all distinct pkgs in the DB
|
||||
con <- DBI::dbConnect(RPostgres::Postgres(),
|
||||
dbname = "build_metadata", host = "r-binaries.devxy.io",
|
||||
port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS"),
|
||||
sslmode = "require"
|
||||
)
|
||||
|
||||
pkgs_db <- query_metadata_table() |>
|
||||
distinct(name) |>
|
||||
pull(name)
|
||||
|
||||
# Check which pkgs in the DB match with the decomissioned ones
|
||||
to_process <- pkgs_db[pkgs_db %in% archived]
|
||||
|
||||
# for all matches, set 'removed = TRUE'
|
||||
sapply(to_process, function(.x) {
|
||||
DBI::dbExecute(con, "UPDATE single_builds SET removed = 'TRUE' where name = $1",
|
||||
params = list(.x)
|
||||
)
|
||||
})
|
||||
Loading…
Reference in a new issue