Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,13 @@ pub fn get_platform(args: &ArgMatches) -> Result<String, Box<dyn Error>> {
if os == "linux" {
let dist = detect_platform()?;
if let (Some(distro), Some(version)) = (dist.distro, dist.version) {
os = format!("linux-{}-{}", distro, version);
// Amazon Linux 2023 is RHEL 9-compatible; the r-hub API
// doesn't know about amzn so we resolve against rhel-9.
if distro == "amzn" && version == "2023" {
os = "linux-rhel-9".to_string();
} else {
os = format!("linux-{}-{}", distro, version);
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/data/repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@
"x86_64",
"aarch64"
]
},
{
"name": "P3M",
"url": "https://packagemanager.posit.co/cran/__linux__/manylinux_2_28/latest",
"platforms": [
"*-linux-gnu-amzn-*"
],
"archs": [
"x86_64",
"aarch64"
],
"enabled": true
}
]
},
Expand Down
8 changes: 8 additions & 0 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ fn select_linux_tools(platform: &OsVersion) -> Result<LinuxTools, Box<dyn Error>
is_installed: strvec!["rpm", "-q", "{}"],
delete: strvec!["zypper", "remove", "-y", "{}"],
})
} else if platform.distro.as_deref() == Some("amzn") {
Ok(LinuxTools {
package_name: "R-{}".to_string(),
install: vec![strvec!["dnf", "install", "-y", "{}"]],
get_package_name: strvec!["rpm", "-q", "--qf", "%{NAME}", "-p", "{}"],
is_installed: strvec!["rpm", "-q", "{}"],
delete: strvec!["dnf", "remove", "-y", "{}"],
})
} else if platform.distro.as_deref() == Some("fedora") {
Ok(LinuxTools {
package_name: "R-{}".to_string(),
Expand Down
Loading