add codename support for alpine
This commit is contained in:
parent
9ffab1b63e
commit
08611e8132
1 changed files with 22 additions and 16 deletions
10
R/helpers.R
10
R/helpers.R
|
|
@ -2,6 +2,13 @@
|
|||
set_codename <- function(codename) {
|
||||
if (is.null(codename)) {
|
||||
if (Sys.info()["sysname"] == "Linux") {
|
||||
if (any(grepl("alpine", system2("cat", args = c("/etc/os-release"), stdout = TRUE)))) {
|
||||
version <- system2("grep",
|
||||
args = c("'^VERSION_ID=' /etc/os-release | cut -d'=' -f2 | tr -d '\"'"), stdout = TRUE
|
||||
)
|
||||
version_stripped <- substr(gsub("\\.", "", version), 1, 3)
|
||||
codename <- paste0("alpine", version_stripped)
|
||||
} else {
|
||||
dist_fam <- system2("grep",
|
||||
args = c("'^ID_LIKE=' /etc/os-release | cut -d'=' -f2 | tr -d '\"'"), stdout = TRUE
|
||||
)
|
||||
|
|
@ -19,11 +26,10 @@ set_codename <- function(codename) {
|
|||
codename <- "rhel8"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
codename <- "unknown"
|
||||
}
|
||||
}
|
||||
return(codename)
|
||||
}
|
||||
}
|
||||
|
||||
#' Helper function to set the path for binary package outputs
|
||||
|
|
|
|||
Loading…
Reference in a new issue