From cd9d911bd3a1d692b512a8c579d81839f2d4712a Mon Sep 17 00:00:00 2001 From: George Stagg Date: Wed, 11 Sep 2024 16:08:26 +0100 Subject: [PATCH] Skip `.data` fallback in `webr::install()` --- packages/webr/R/install.R | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/webr/R/install.R b/packages/webr/R/install.R index 4bfc731a..e9a9a7eb 100644 --- a/packages/webr/R/install.R +++ b/packages/webr/R/install.R @@ -67,19 +67,12 @@ install <- function(packages, if (!quiet) message(paste("Downloading webR package:", pkg)) if (mount) { - # Try mounting `.tgz` as v2.0 image, fallback to `.data` v1.0 image + # Try mounting `.tgz` as v2.0 VFS image, fallback to extracting the .tgz tryCatch({ - install_vfs_image(repo, lib, pkg, pkg_ver, ".tgz") + install_vfs_image(repo, lib, pkg, pkg_ver) next }, error = function(cnd) { - warning(paste(cnd$message, "Falling back to `.data` filesystem image.")) - }) - - tryCatch({ - install_vfs_image(repo, lib, pkg, pkg_ver, ".data") - next - }, error = function(cnd) { - warning(paste(cnd$message, "Falling back to copying archive contents.")) + warning(paste(cnd$message, "Falling back to traditional `.tgz` extraction.")) }) } @@ -102,8 +95,8 @@ install_tgz <- function(repo, lib, pkg, pkg_ver) { ) } -install_vfs_image <- function(repo, lib, pkg, pkg_ver, ext) { - data_url <- file.path(repo, paste0(pkg, "_", pkg_ver, ext)) +install_vfs_image <- function(repo, lib, pkg, pkg_ver) { + data_url <- file.path(repo, paste0(pkg, "_", pkg_ver, ".tgz")) mountpoint <- file.path(lib, pkg) mount(mountpoint, data_url) }