If path is a directory, looks for PACKAGES.rds, then
PACKAGES.gz, then plain PACKAGES and reads the first one found. If
path is a file, reads based on its extension: "" (plain PACKAGES),
"gz" (PACKAGES.gz), or "rds" (PACKAGES.rds).