Skip to content

Commit f426891

Browse files
authored
Merge pull request #960 from minrk/r4
2 parents dce7984 + dd3fa63 commit f426891

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

repo2docker/buildpacks/r.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def r_version(self):
7575
"3.6": "3.6.1-3bionic",
7676
"3.6.0": "3.6.0-2bionic",
7777
"3.6.1": "3.6.1-3bionic",
78+
"4.0": "4.0.2-1.1804.0",
79+
"4.0.2": "4.0.2-1.1804.0",
7880
}
7981
# the default if nothing is specified
8082
r_version = "3.6"
@@ -232,13 +234,17 @@ def get_build_scripts(self):
232234

233235
scripts = []
234236
# For R 3.4 we want to use the default Ubuntu package but otherwise
235-
# we use the packages from a PPA
237+
# we use the packages from R's own repo
236238
if V(self.r_version) >= V("3.5"):
239+
if V(self.r_version) >= V("4"):
240+
vs = "40"
241+
else:
242+
vs = "35"
237243
scripts += [
238244
(
239245
"root",
240-
r"""
241-
echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" > /etc/apt/sources.list.d/r3.6-ubuntu.list
246+
rf"""
247+
echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran{vs}/" > /etc/apt/sources.list.d/r-ubuntu.list
242248
""",
243249
),
244250
# Use port 80 to talk to the keyserver to increase the chances

tests/r/r4/install.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install.packages("ggplot2")

tests/r/r4/runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
r-4.0-2020-07-07

tests/r/r4/verify

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env Rscript
2+
library('ggplot2')
3+
4+
print(version)
5+
if (version$major != "4") {
6+
quit("yes", 1)
7+
}

0 commit comments

Comments
 (0)