From Kurt@Hornik @ending from wu@@c@@t  Wed Oct 24 10:23:50 2018
From: Kurt@Hornik @ending from wu@@c@@t (Kurt Hornik)
Date: Wed, 24 Oct 2018 10:23:50 +0200
Subject: [Rd] Suggestion: Make CRAN source URLs immutable
In-Reply-To: <CAH--+mZTEXEhkhb=_3v2RfkiV=JVr0C9gvib2q4zHvJFxO-WdA@mail.gmail.com>
References: <CAH--+mZTEXEhkhb=_3v2RfkiV=JVr0C9gvib2q4zHvJFxO-WdA@mail.gmail.com>
Message-ID: <23504.11286.787374.78528@hornik.net>

>>>>> Kurt Wheeler writes:

Try e.g.

https://cran.r-project.org/package=httr&version=1.3.1
https://cran.r-project.org/package=httr&version=1.3.0

-k

> Hello, I hope the is the right list to send this suggestion to.
> I was wondering if it might be possible to have CRAN store the most current
> version of a package's source tarball at a location that does not change.
> As an example, the source tarball for `httr` is stored at
> https://cran.r-project.org/src/contrib/httr_1.3.1.tar.gz. However, once the
> next version of `httr` is released, the URL for version 1.3.1 of `httr`
> will change to
> https://cran.r-project.org/src/contrib/Archive/httr_1.3.1.tar.gz.

> The implications of this are that if I want to write a script which
> installs version 1.3.1 of `httr`, I need to do so like this:

> ```
> httr_url <- "https://cran.r-project.org/src/contrib/httr_1.3.1.tar.gz"

> curl_result <- system(paste0("curl --head ", httr_url), intern=TRUE)
> if (grepl("404", curl_result[1])) {
>   httr_url <- "
> https://cran.r-project.org/src/contrib/Archive/httr_1.3.1.tar.gz"
> }

> install.packages(httr_url)
> ```

> I think there are two obvious ways of remedying this issue. The first would
> be to simply archive the most recent version along with all the old
> versions. Then to install a specific version of a package, it would just be:

> ```
> install.packages("
> https://cran.r-project.org/src/contrib/Archive/httr_1.3.1.tar.gz")
> ```

> even if 1.3.1 is the most recent version of `httr`.


> The other way to remedy this issue would be to simply not use the
> `/Archive/` sub-directory. So if I wanted to install an old version of
> `httr` it would be:

> ```
> install.packages("https://cran.r-project.org/src/contrib/httr_1.3.0.tar.gz")
> ```

> despite the fact that version 1.3.0 is not the most recent version.


> I believe the first way would be a better choice because then any existing
> scripts which reference URLs which include `/Archive/` would still work.
> However I do not have strong opinions on how this should be implemented, I
> would just like a URL which points to a certain version of a package that
> will never change.

> Thank you,

> - Kurt

> 	[[alternative HTML version deleted]]

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



[Rd] Suggestion: Make CRAN source URLs immutable
Kurt Hornik