Skip to content

Commit

Permalink
Fix regexp in check_installed() to accept package names with dots ins…
Browse files Browse the repository at this point in the history
…ide them. Closes #12.
  • Loading branch information
DesiQuintans committed Feb 15, 2019
1 parent 5e05e1f commit a47dfaf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: librarian
Title: Install, Update, Load Packages from CRAN, 'GitHub', and 'Bioconductor' in One Step
Version: 1.5.3
Date: 2019-01-24
Version: 1.5.4
Date: 2019-02-15
Authors@R: person("Desi", "Quintans", email = "science@desiquintans.com",
role = c("aut", "cre"))
Description: Automatically install, update, and load 'CRAN', 'GitHub', and 'Bioconductor'
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# librarian 1.5.4 (2019-02-15)

- FIX - The regular expression used in `librarian:::check_installed()` failed if the package name had a `.` inside it, so those packages were installable but not attachable with _librarian_. Closes [#12](https://github.com/DesiQuintans/librarian/issues/12).



# librarian 1.5.3 (2019-01-24)

- MOD - Less alarming and more informative message (not a warning) for when the `cran_repo` argument in `shelf()` contains the default R value `@CRAN@`. Closes [Issue #10](https://github.com/DesiQuintans/librarian/issues/10). Thanks, Jim Hunter!
Expand Down
3 changes: 2 additions & 1 deletion R/private_funs.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ check_installed <- function(packages = NULL) {
return(rownames(utils::installed.packages())) # Very slow!
} else {
found_pkgs <- find.package(packages, quiet = TRUE)
found_pkg_names <- gsub("^.*?(\\w+)$", "\\1", found_pkgs) # Remove directory path
# Last directory of find.package() output is package folder.
found_pkg_names <- gsub("^.*?(/|\\\\)(.*?)$", "\\2", found_pkgs)
status <- packages %in% found_pkg_names
names(status) <- packages

Expand Down

0 comments on commit a47dfaf

Please sign in to comment.