r-lib / pkgdepends

R Package Dependency Resolution
https://r-lib.github.io/pkgdepends/
Other
97 stars 31 forks source link

Parse error with absolute windows paths #245

Open richfitz opened 3 years ago

richfitz commented 3 years ago

The local file detection seems not to allow windows absolute paths:

> pkgdepends::parse_pkg_ref("C:/path/to/file.tar.gz")
Error in get_remote_types(refs) : 
  Can't parse remotes: C:/path/to/file.tar.gz

If I add local:: in front it of course is handled fine. Unix-style absolute paths are allowed even when the file does not exist:

pkgdepends::parse_pkg_ref("/path/to/file.tar.gz")
shun2wang commented 1 week ago

I also have this problem, how to avoid this? thanks.

gaborcsardi commented 1 week ago

I am not sure if this is a bug. Using a path instead of local:: + path is a syntactic sugar. If you use pak/pkgdepends programmatically with a path, always use local::.

That said, we could probably allow the <device-letter>:/... and <device-letter>:\\... forms.