Downloads and reads the repository index from an S3 bucket (under
src/contrib). Prefers PACKAGES.rds, then PACKAGES.gz, then plain
PACKAGES. If none exist, returns an empty pkg_index with a warning.
The returned object is a pkg_index data frame. For convenience, the
following attributes are attached:
s3_bucket: the bucket name useds3_key: the object key that was read (orNULLif none)s3_etag: the ETag of the object that was read (orNA_character_)
This function relies on the AWS CLI and the helpers s3_etag() and
s3_download() that error on failures.
Details
Only the index files are downloaded; package archives are never fetched.
The repository root is assumed to be src/contrib.
Examples
if (FALSE) { # \dontrun{
# Read the current index (prefers PACKAGES.rds)
idx <- s3cran_read_pkg_index("g6tr-cran")
idx
attr(idx, "s3_etag")
} # }