Support R older than 1.3.1
There were changes but R older than 2.5 were really different, e.g. no seq_along; versions older than 1.9 can't even use snake case.
A even safer approach is to use bash to wget and R CMD INSTALL instead. I can only install source package in R 1.3.1 this way.
For the time being:
utils::compareVersion(granlist$r_version, "3.1") == -1
Stop dockerize (No Rocker Image)
utils::compareVersion(granlist$r_version, "2.5") == -1
Stop export_granlist (saying not tested)
All the functions in header.R and footer.R:
snake case: R 1.9.0
paste0: R 2.15.0 (Should be replaced by paste0(..., sep = ""))
tempdir: R 1.6.0
supressWarnings: R 1.8.0
tryCatch: R 1.8.0
seq_along: R 2.4.0 (Should be replaced by a check and then 1:length(install_order))
All other functions should be safe. Maybe minimum version of R 1.8.0 should be declared as the tryCatch block is needed.
Also, state somehwhere that the generated installation script might not look idiomatic now.
However, if #17 is implemented, it is safe to go older than R 1.8.0.
install.packages can only be used to install source packages since R 2.1.0.
verbose and quiet were introduced since R 3.0.0.
It is safer to say the current export_granlist can support up to R 2.1.0; can keep the snake case too, but need to fix paste0 and seq_along. Ignore verbose and quiet. And test.
For older versions, shell script approach should be used.
This can be cited: https://www.r-project.org/doc/Rnews/Rnews_2005-1.pdf
Ripley, B. (2005) Packages and their Management in R 2.1.0. R News
Debian Etch / Lenny can be used to compile R 2.1 to R 3.0.
Proposed Dockerfile for R < 3.1.0.
R-2 and R-2.13.0 need to be changeable.
FROM debian/eol:lenny
ENV TZ UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt-get update -qq && apt-get install wget locales build-essential r-base-dev -y
RUN wget http://cran.r-project.org/src/base/R-2/R-2.13.0.tar.gz \
&& tar -zxf R-2.13.0.tar.gz \
&& cd R-2.13.0 \
&& ./configure --without-x ; make \
&& make install
COPY gran.R ./gran.R
RUN Rscript gran.R
CMD ["R"]
ah dar...
#17 dir.exists is only available since 3.2.0.
TODOs
- [x] eschew all snake cases in
inst/header.Randinst/footer.R - [x] Check for R version and use R CMD if R version is older than 2.1
- [x] Test, test, test
- [x] Check the oldest version of R that can be compiled/installed with Lenny.
lenny = 1.8.0
Update: actually 1.6.0 / 1.5.0 / 1.4.0 / 1.3.1 work; only 1.7.x series doesn't work.
There should be an option like "skip_r1.7 = TRUE"
Will use 1.3.1 as the reference version to write header and footer
etch doesn't have libcurl4-openssl-dev, should drop.
R 1.3.1 doesn't even have compareVersion. Maybe a better approach for <= R 2.1 is to use pure bash (which doesn't sound too bad).
The issue is for supporting 1.3.0 or below is the compilation fails on Lenny.
#165