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]]
>>>>> 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
On Wed, 24 Oct 2018 at 11:40, Kurt Hornik <Kurt.Hornik at wu.ac.at> wrote:> > >>>>> 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.0This is a nice feature that I didn't know. I recently proposed enforcing this scheme in Fedora's packaging guidelines, because in this way, a SPEC would build correctly even if the package was updated and the old version was archived (is this guaranteed to continue to work in future? I assumed so...). There is an odd thing about this format though, and that is the absence of a file extension. This is a redirection, yes, but the spectool can't trust the filename that is sent by the remote server, and uses only the filename extracted from the URL. Without extension, RPM doesn't know how to unpack the sources. So we have to do the following similarly odd trick (note the "#"): Source0: https://cran.r-project.org/package=%{packname}&version=%{version}#/%{packname}_%{version}.tar.gz Did you consider this problem? Is there any alternate immutable URL *with* extension? If not, is there any potential issue with the trick above? Regards, -- I?aki Ucar