Bug 16400 - add an option to release caching of available.packages metadata
Summary: add an option to release caching of available.packages metadata
Alias: None
Product: R
Classification: Unclassified
Component: Wishlist (show other bugs)
Version: R 3.2.0
Hardware: All All
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2015-05-26 22:11 UTC by Yasmin Lucero
Modified: 2015-05-26 22:30 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Yasmin Lucero 2015-05-26 22:11:26 UTC
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.
Comment 1 Duncan Murdoch 2015-05-26 22:30:45 UTC
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.