31 lines
1.1 KiB
Shell
31 lines
1.1 KiB
Shell
#!/bin/bash
|
|
|
|
# source: https://stackoverflow.com/a/55337537/4185785
|
|
|
|
echo '
|
|
library(plyr)
|
|
generateArchive <- function(archiveDir) {
|
|
archive <- file.info(list.files(archiveDir, recursive = TRUE, full.names = TRUE, pattern = "*.tar.gz"))
|
|
archive$packageName <- basename(dirname(rownames(archive)))
|
|
archive$packageFile <- basename(rownames(archive))
|
|
archive <- dlply(archive, "packageName", function(x) {
|
|
rownames(x) <- paste0(x$packageName, "/", x$packageFile)
|
|
x$packageName <- NULL
|
|
x$packageFile <- NULL
|
|
x
|
|
})
|
|
}
|
|
|
|
archiveDir <- "/root/__linux__/rhel9/4.3/latest/src/contrib/Archive"
|
|
metaPath <- "/root/__linux__/rhel9/4.3/latest/src/contrib//Meta"
|
|
dir.create(metaPath, showWarnings = FALSE)
|
|
archive <- generateArchive(archiveDir)
|
|
attr(archive, "split_type") <- NULL
|
|
attr(archive, "split_labels") <- NULL
|
|
saveRDS(archive, file.path(metaPath, "archive.rds"))
|
|
' >/root/create-archive.R
|
|
|
|
Rscript /root/create-archive.R
|
|
|
|
# sync Meta/archive.rds
|
|
aws s3 cp /root/__linux__/rhel9/4.3/latest/src/contrib/Meta/archive.rds s3://cynkra-r-binaries-arm64/__linux__/rhel9/4.3/latest/src/contrib/Meta/archive.rds --acl public-read
|