Skip to content

Commit

Permalink
fix: --without-sysreqs works (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Sep 24, 2023
1 parent f228ce0 commit 1e33578
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ pub fn sc_add(args: &ArgMatches) -> Result<(), Box<dyn Error>> {
}

set_ppm(Some(vec![dirname.to_string()]), &platform)?;
set_sysreqs(Some(vec![dirname.to_string()]))?;

if args.get_flag("without-sysreqs") {
set_sysreqs_false(Some(vec![dirname.to_string()]))?;
}

if !args.get_flag("without-pak") {
let explicit = args.value_source("pak-version") ==
Expand Down Expand Up @@ -606,7 +609,7 @@ options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(
Ok(())
}

fn set_sysreqs(vers: Option<Vec<String>>) -> Result<(), Box<dyn Error>> {
fn set_sysreqs_false(vers: Option<Vec<String>>) -> Result<(), Box<dyn Error>> {
info!("Setting up automatic system requirements installation.");

let vers = match vers {
Expand All @@ -615,8 +618,7 @@ fn set_sysreqs(vers: Option<Vec<String>>) -> Result<(), Box<dyn Error>> {
};

let rcode = r#"
Sys.setenv(PKG_SYSREQS = "true")
Sys.setenv(PKG_SYSREQS2 = "true")
if (Sys.getenv("PKG_SYSREQS") == "") Sys.setenv(PKG_SYSREQS = "false")
"#;

for ver in vers {
Expand Down

0 comments on commit 1e33578

Please sign in to comment.