build-cran-binaries/local/query-pkgs-without-old-versions.R
pat-s a9ad907f9c
chore(local): add S3 migration and CRAN-source helper scripts
- migrate-s3-hetzner-to-backblaze.sh: rclone-based bucket migration helper.
- find-R-api-packages.sh: scan CRAN package sources for a C-API usage pattern.
- query-pkgs-without-old-versions.R, test-package-loading.R: ad-hoc helpers.
2026-06-14 13:02:48 +02:00

39 lines
978 B
R

library(s3fs)
# List all files under contrib/<pkg>/
all_files <- s3fs::s3_dir_ls(
"s3://devxy-r-package-binaries-hel1/arm64/alpine322/latest/src/contrib/",
recurse = TRUE,
type = "file"
)
pattern <- ".*/src/contrib/([^/_]+)_.*"
matches <- regmatches(all_files, regexec(pattern, all_files))
pkg_names <- unique(
vapply(
matches,
function(x) if (length(x) > 1) x[2] else NA_character_,
character(1)
)
)
pkg_names <- pkg_names[!is.na(pkg_names)]
# For each package, check if Archive/<pkg>/ contains any files
no_archive_files <- character(0)
for (pkg in pkg_names) {
archive_dir1 <- sprintf(
"s3://devxy-r-package-binaries-hel1/arm64/alpine322/latest/src/contrib/Archive/%s",
pkg
)
archive_files <- unique(c(
tryCatch(
s3fs::s3_dir_ls(archive_dir1, recurse = TRUE),
error = function(e) character(0)
)
))
if (length(archive_files) == 0) {
no_archive_files <- c(no_archive_files, pkg)
}
}
print(no_archive_files)