chore: update local/ files
This commit is contained in:
parent
6a62efe646
commit
a78d489aac
1 changed files with 78 additions and 9 deletions
42
local/missing-cran-packages-db.R
Normal file
42
local/missing-cran-packages-db.R
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
### Scope: Lists packages which are missing any DB entry compared to what is available on CRAN
|
||||
library(bincraftR)
|
||||
library(dplyr)
|
||||
library(DBI)
|
||||
|
||||
con <- DBI::dbConnect(RPostgres::Postgres(),
|
||||
dbname = "build_metadata", host = "r-binaries.devxy.io",
|
||||
port = 15432, user = "r_binaries", password = Sys.getenv("PGPASS"),
|
||||
sslmode = "require"
|
||||
)
|
||||
|
||||
`%nin%` <- Negate(`%in%`)
|
||||
|
||||
new_packages <- get_new_cran_packages(lubridate::interval(lubridate::today(), lubridate::today() - 2))$name
|
||||
removed_pkgs <- get_removed_cran_packages(lubridate::interval(lubridate::today(), lubridate::today() - 2))$name
|
||||
# filter windows packages
|
||||
# filter new packages from the last X days
|
||||
cran_pkgs <- unique(tools::CRAN_package_db() |>
|
||||
filter(`OS_type` != "windows" | is.na(`OS_type`)) |>
|
||||
filter(`Package` %nin% new_packages) |>
|
||||
pull(Package))
|
||||
|
||||
arch <- "amd64"
|
||||
platform <- "redhat-8"
|
||||
platform <- "redhat-9"
|
||||
platform <- "alpine-320"
|
||||
platform <- "ubuntu-2204"
|
||||
platform <- "ubuntu-2404"
|
||||
|
||||
data <- dbGetQuery(con, "SELECT name FROM single_builds WHERE platform = $1 AND arch = $2 and removed = FALSE;", params = list(platform, arch))
|
||||
removed_pkgs = get_removed_cran_packages(lubridate::interval(lubridate::today(), lubridate::today() - 2))$name
|
||||
pkgs_db <- unique(data$name)
|
||||
pkgs_db = setdiff(pkgs_db, removed_pkgs)
|
||||
|
||||
pkgs <- setdiff(cran_pkgs, pkgs_db)
|
||||
formatted_pkgs <- gsub('"', "'", capture.output(dput(as.character(na.omit(pkgs[1:900])))))
|
||||
formatted_pkgs_one_line <- paste(formatted_pkgs, collapse = " ")
|
||||
|
||||
cat(formatted_pkgs_one_line, "\n", sep = "")
|
||||
length(formatted_pkgs)
|
||||
|
||||
clipr::write_clip(formatted_pkgs_one_line)
|
||||
Loading…
Reference in a new issue