library(s3fs) # List all files under contrib// 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// 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)