remotes::install_local() 仍然尝试获取远程存储库

问题描述 投票:0回答:1

我有两个包裹,

packageone
packagetwo
packagetwo
导入
packageone
并在描述中列出存储库 URL:

Remotes:
    git::http://url/to/packageone.git

我正在与一位无法访问

packageone
packagetwo
存储库(公司政策)的同事一起工作,因此我的好主意是将存储库压缩并交给我的同事通过
remotes::install_local()
安装:

remotes::install_local("path/to/packageone", upgrade = "never")
remotes::install_local("path/to/packagetwo", upgrade = "never")

但他们收到错误,因为

remotes::install_local()
仍在尝试访问存储库 URL,即使
packageone
已安装。

Error: Failed to install 'packagetwo' from local:
  Command failed (128)
In addition: Warning message:
In system(full, intern = TRUE, ignore.stderr = quiet) :
  running command ''/usr/bin/git' ls-remote http://url/to/packageone.git  2>/dev/null' had status 128 and error message 'Function not implemented'

如何告诉

remotes::install_local()
忽略“描述遥控器”部分中指定的 URL?请注意,
packagetwo
也有 CRAN 依赖项,所以我仍然想安装它们。

r
1个回答
0
投票

当前的解决方法是首先安装除

packageone
之外的所有依赖项:

install.packages(stringr::str_subset(remotes::local_package_deps("path/to/packagetwo"), "packageone", negate = TRUE))
remotes::install_local("path/to/packagetwo", dependencies = FALSE)

但我希望有一个更简化的解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.