Skip to content

Commit

Permalink
update packages only in libraries that are writable by the current user
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Mar 6, 2024
1 parent 5dabc45 commit 6ca7901
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: xfun
Type: Package
Title: Supporting Functions for Packages Maintained by 'Yihui Xie'
Version: 0.42.3
Version: 0.42.4
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person("Wush", "Wu", role = "ctb"),
Expand Down
5 changes: 4 additions & 1 deletion R/packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ pkg_require = function(pkgs, which = length(sys.calls()) - 1) {
)
}

# update all packages in libraries that are writable by the current user
pkg_update = function(...) {
update.packages(ask = FALSE, checkBuilt = TRUE, ...)
libs = .libPaths()
libs = libs[file.access(libs, 2) >= 0]
for (l in libs) update.packages(l, ask = FALSE, checkBuilt = TRUE, ...)
}

# allow users to specify a custom install.packages() function via the global
Expand Down

0 comments on commit 6ca7901

Please sign in to comment.