Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teach remotes about the 'standard' remote type #310

Merged
merged 1 commit into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# remotes dev

* remotes now understands the "standard" remote type, as produced by packages
installed from CRAN using `pak` (#309)

* Fix return type of `install_remote()` when there is a circular dependency (#225)

* `remote_package_name.github_remote()` now works properly on Windows (#248)
Expand Down
8 changes: 7 additions & 1 deletion R/install-remote.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ package2remote <- function(name, lib = .libPaths(), repos = getOption("repos"),
}

switch(x$RemoteType,
standard = remote("cran",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't know if this would cause problems here, but "standard" just means that it was coming from a CRAN-like repo.

I think remotes will be fine with "cran", though....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this was the easiest way (at least for now) to have remotes just treat these standard remote types as CRAN-like, since cran remotes are already well-understood and handled elsewhere in the system. Do you think this should be handled differently?

At least, I believe this works as a stop-gap solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be fine. I think for remotes "cran" means "cran-like", mostly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimhester do you think this would fail in any way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this would be fine.

name = x$Package,
repos = x$RemoteRepos,
pkg_type = x$RemotePkgType,
sha = x$RemoteSha),
github = remote("github",
host = x$RemoteHost,
package = x$RemotePackage,
Expand Down Expand Up @@ -231,7 +236,8 @@ package2remote <- function(name, lib = .libPaths(), repos = getOption("repos"),
repo = x$RemoteRepo,
release = x$RemoteRelease,
sha = x$RemoteSha,
branch = x$RemoteBranch)
branch = x$RemoteBranch),
stop(sprintf("can't convert package with RemoteType '%s' to remote", x$RemoteType))
)
}

Expand Down