You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local CRAN repositories may have duplicated packages (same name with different versions). For example, if a repository owner uploads package PKG v1.0 and PKG 2.0 to their CRAN repository, PACKAGE in contriburl is like:
Package: PKG
Version: 1.0
Depends: anotherpkg
MD5sum: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
NeedsCompilation: no
Package: PKG
Version: 2.0
Depends: anotherpkg
MD5sum: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
NeedsCompilation: no
This is not abnormal as tools::write_PACKAGES(latestOnly = FALSE) can generate so.
The current version of download_version_url uses available.packages with default filters which means c("R_version", "OS_type", "subarch", "duplicates"). "duplicates" means it returns the latest version if duplicated packages are found (see help(available.packages)).
There are two problems. The first problem is, if users call download_version("PKG", "1.0", "https://my_local_repo") with default filters, it raises an error (if there's no Archive directory like official CRAN) because the latest version of PKG is not 1.0 but 2.0. The second problem is, if users set the available_packages_filters option like c("R_version", "OS_type", "subarch"), the user cannot download the latest version with download_version("PKG", "2.0", "https://my_local_repo").
My suggestion to resolve the problems is that download_version_url should consider the available_packages_filters option and remove "duplicates" filter. If users do not set the available_packages_filters option, the function use c("R_version", "OS_type", "subarch"). If users do set the available_packages_filters option, the function uses setdiff(user_filters, "duplicates").
The text was updated successfully, but these errors were encountered:
I thought version = NULL will download the latest version (as documented in the current version of remotes::download_version), but I found the HEAD version doesn't specify the behavior of version = NULL.
Local CRAN repositories may have duplicated packages (same name with different versions). For example, if a repository owner uploads package PKG v1.0 and PKG 2.0 to their CRAN repository, PACKAGE in contriburl is like:
This is not abnormal as
tools::write_PACKAGES(latestOnly = FALSE)
can generate so.The current version of
download_version_url
usesavailable.packages
with default filters which meansc("R_version", "OS_type", "subarch", "duplicates")
."duplicates"
means it returns the latest version if duplicated packages are found (seehelp(available.packages)
).There are two problems. The first problem is, if users call
download_version("PKG", "1.0", "https://my_local_repo")
with default filters, it raises an error (if there's no Archive directory like official CRAN) because the latest version of PKG is not 1.0 but 2.0. The second problem is, if users set theavailable_packages_filters
option likec("R_version", "OS_type", "subarch")
, the user cannot download the latest version withdownload_version("PKG", "2.0", "https://my_local_repo")
.My suggestion to resolve the problems is that
download_version_url
should consider theavailable_packages_filters
option and remove"duplicates"
filter. If users do not set theavailable_packages_filters
option, the function usec("R_version", "OS_type", "subarch")
. If users do set theavailable_packages_filters
option, the function usessetdiff(user_filters, "duplicates")
.The text was updated successfully, but these errors were encountered: