build-cran-binaries/local/archive-missed-pkgs.R
2024-12-23 14:36:45 +01:00

20 lines
No EOL
937 B
R

### Scope: Archive packages that have more than one entry in repository root
library(bincraftR)
s3fs::s3_file_system(
aws_access_key_id = Sys.getenv("HETZNER_S3_ACCESS_KEY_K3S"),
aws_secret_access_key = Sys.getenv("HETZNER_S3_SECRET_KEY_K3S"),
endpoint = "https://fsn1.your-objectstorage.com",
region_name = "fsn1",
)
arch = "amd64"
os = "noble"
files <- s3fs::s3_dir_ls(sprintf("devxy-r-package-binaries/%s/%s/latest/src/contrib", arch, os))
length(unique(sapply(strsplit(basename(files), "_"), function(x) x[1])))
non_archived = unique(sapply(strsplit(basename(files), "_"), function(x) x[1])[duplicated(sapply(strsplit(basename(files), "_"), function(x) x[1]))])
# RInno is not built because it only exists for Windows
non_archived = setdiff(non_archived, "RInno")
future::plan("sequential", workers = 8)
future.apply::future_lapply(non_archived, function(x) archive_package(x, codename = os, arch = arch))
archive_package()