From b8496064ec5d19d3f30e9598b1d94ca24e3dbdcf Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Fri, 3 Apr 2020 12:19:55 +0300 Subject: [PATCH] Disable tlmgr in linux (fix #384) (#389) --- src/error.rs | 1 + src/main.rs | 1 + src/steps/generic.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 76c4e4fb..f248faf9 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,6 +7,7 @@ pub enum TopgradeError { ProcessFailed(ExitStatus), #[error("Sudo is required for this step")] + #[allow(dead_code)] SudoRequired, #[error("Unknown Linux Distribution")] diff --git a/src/main.rs b/src/main.rs index b5db47ab..4813f343 100644 --- a/src/main.rs +++ b/src/main.rs @@ -274,6 +274,7 @@ fn run() -> Result<()> { } if config.should_run(Step::Tlmgr) { + #[cfg(not(target_os = "linux"))] runner.execute("tlmgr", || { generic::run_tlmgr_update( #[cfg(unix)] diff --git a/src/steps/generic.rs b/src/steps/generic.rs index 823f33d5..638e0c0c 100644 --- a/src/steps/generic.rs +++ b/src/steps/generic.rs @@ -1,6 +1,6 @@ +#![allow(unused_imports)] use crate::error::{SkipStep, TopgradeError}; use crate::execution_context::ExecutionContext; -#[allow(unused_imports)] use crate::executor::{CommandExt, ExecutorOutput, RunType}; use crate::terminal::{print_separator, shell}; use crate::utils::{self, PathExt}; @@ -117,6 +117,7 @@ pub fn run_stack_update(run_type: RunType) -> Result<()> { run_type.execute(&stack).arg("upgrade").check_run() } +#[cfg(not(target_os = "linux"))] pub fn run_tlmgr_update(sudo: &Option, run_type: RunType) -> Result<()> { let tlmgr = utils::require("tlmgr")?; let kpsewhich = utils::require("kpsewhich")?;