Currently, available.packages caches the PACKAGES metadata on a per session basis. An exception is made for a 'local repository', where a 'local repository' is only recognized if the user uses the file URI. This means that the repo must be mounted to the file system in order to be recognized as local.
I have a use case where my local repo is not mounted, I am accessing it via http. My deployment script makes changes to the repo, and then attempts to use the updated repo to install a user library. However, because of the cached PACKAGES metadata, I cannot do this without restarting my session.
I tried to delete the tmp file, but this failed:
cached_PACKAGES <- file.path(paste0('repos_', URLencode(getOption('repos'), TRUE), '.rds'))
file.remove(file.path(paste0(tempdir(), '/', cached_PACKAGES)))
presumably my rsession is holding onto the file?
Anyway, I would like an option to clear this cache.
This is a very special need, with an easy workaround (just restart your session). That makes it a low priority for me, but if you submit a tested, documented patch, I'll commit it.