From d64c2c27fd35eb702d9b76478aaf91fe499f8bc3 Mon Sep 17 00:00:00 2001 From: Mirko Brombin Date: Mon, 28 Nov 2022 15:19:36 +0100 Subject: [PATCH] core: Use abroot if installed --- vanilla_first_setup/utils/processor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vanilla_first_setup/utils/processor.py b/vanilla_first_setup/utils/processor.py index 861ea57..6f2328e 100644 --- a/vanilla_first_setup/utils/processor.py +++ b/vanilla_first_setup/utils/processor.py @@ -15,6 +15,7 @@ # along with this program. If not, see . import os +import shutil import logging import tempfile import subprocess @@ -28,6 +29,7 @@ class Processor: @staticmethod def run(log_path, pre_run, post_run, commands): commands = pre_run + commands + post_run + abroot_bin = shutil.which("abroot") logger.info("processing the following commands: \n%s" % '\n'.join(commands)) @@ -39,9 +41,15 @@ class Processor: f.write("# This file was created by FirstSetup\n") f.write("# Do not edit this file manually\n\n") + if abroot_bin := shutil.which("abroot"): + f.write("abroot exec <