Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongzhuoer/dd332dc13ef06ee4447f69aaacbdcb1a to your computer and use it in GitHub Desktop.
Save dongzhuoer/dd332dc13ef06ee4447f69aaacbdcb1a to your computer and use it in GitHub Desktop.
This script is used before `update.packages(ask = F)` on Travis CI R
@dongzhuoer
Copy link
Author

dongzhuoer commented Apr 5, 2018

When building R package with Travis, we want to the dependency packages to be the latest and well cached.

Although update.packages(ask = F) is very convenient when you run in sudo mode, Travis only caches user library.

After a awful afternoon, I come up with a solution:

Move recommended packages (system packages get updated along with R) to user library if they don't exist, then they can be cached. The next time, recommended packages in system library will be removed. (While there seem be a override rule, we still tend to avoid duplicate. Actually, Travis will get a warning when it just update the one in user library)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment