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.
This commit is contained in:
parent
3ae4672d66
commit
a9ad907f9c
1 changed files with 494 additions and 0 deletions
39
local/query-pkgs-without-old-versions.R
Normal file
39
local/query-pkgs-without-old-versions.R
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
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)
|
||||
Loading…
Reference in a new issue