[R-pkg-devel] Order of repo access from options("repos")

Martin Morgan mtmorg@n@xyz @end|ng |rom gm@||@com
Sun Mar 31 13:43:03 CEST 2024


available.packages indicates that

     By default, the return value includes only packages whose version
     and OS requirements are met by the running version of R, and only
     gives information on the latest versions of packages.

So all repositories are consulted and then the result filtered to contain just the most recent version of each. Does it matter then what order the repositories are visited?

Martin Morgan

From: R-package-devel <r-package-devel-bounces using r-project.org> on behalf of Greg Hunt <greg using firmansyah.com>
Date: Sunday, March 31, 2024 at 7:35 AM
To: Dirk Eddelbuettel <edd using debian.org>
Cc: List r-package-devel <r-package-devel using r-project.org>
Subject: Re: [R-pkg-devel] Order of repo access from options("repos")
Dirk,
Sadly I can't use localhost for all of those.  172.17.0.1 is an internal
Docker IP, not the localhost address (127.0.0.1), they are there to handle
two different scenarios and different ones will fail to resolve in
different scenarios.  Are you saying that the DNS lookup adds a timing
issue to the search order?  Isn't the list deterministically ordered?


Greg

On Sun, 31 Mar 2024 at 22:15, Dirk Eddelbuettel <edd using debian.org> wrote:

>
> Greg,
>
> There are AFAICT two issues here: how R unrolls the named vector that is
> the
> 'repos' element in the list 'options', and how your computer resolves DNS
> for
> localhost vs 172.17.0.1.  I would try something like
>
>    options(repos = c(CRAN = "http://localhost:3001/proxy",
>                      C = "http://localhost:3002",
>                      B = "http://localhost:3003/proxy",
>                      A = "http://localhost:3004"))
>
> or the equivalent with 172.17.0.1. When I do that here I get errors from
> first to last as we expect:
>
>    > options(repos = c(CRAN = "http://localhost:3001/proxy",
>                      C = "http://localhost:3002",
>                      B = "http://localhost:3003/proxy",
>                      A = "http://localhost:3004"))
>    > available.packages()
>    Warning: unable to access index for repository
> http://localhost:3001/proxy/src/contrib:
>      cannot open URL 'http://localhost:3001/proxy/src/contrib/PACKAGES'
>    Warning: unable to access index for repository
> http://localhost:3002/src/contrib:
>      cannot open URL 'http://localhost:3002/src/contrib/PACKAGES'
>    Warning: unable to access index for repository
> http://localhost:3003/proxy/src/contrib:
>      cannot open URL 'http://localhost:3003/proxy/src/contrib/PACKAGES'
>    Warning: unable to access index for repository
> http://localhost:3004/src/contrib:
>      cannot open URL 'http://localhost:3004/src/contrib/PACKAGES'
>         Package Version Priority Depends Imports LinkingTo Suggests
> Enhances License License_is_FOSS License_restricts_use OS_type Archs MD5sum
> NeedsCompilation File Repository
>    >
>
> Dirk
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>

        [[alternative HTML version deleted]]

______________________________________________
R-package-devel using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list