Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-11-01 10:59:51 +0000
committerAnton Hvornum <anton.feeds@gmail.com>2021-11-01 10:59:51 +0000
commitb3aba8d855c48b03f53f1f0fb0eb3f7978b089a4 (patch)
tree851f98f678759943b796046b426de3515ef6eb15 /archinstall
parentb8808491937a6140c9b4df00b4f27ef0405344a4 (diff)
Improved run_as for installation.arch_chroot()
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/installer.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 0bdddb2e..cbd62692 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1,4 +1,5 @@
import time
+import shlex
from .disk import *
from .hardware import *
from .locale_helpers import verify_keyboard_layout, verify_x11_keyboard_layout
@@ -265,9 +266,9 @@ class Installer:
def run_command(self, cmd, *args, **kwargs):
return SysCommand(f'/usr/bin/arch-chroot {self.target} {cmd}')
- def arch_chroot(self, cmd, *args, **kwargs):
- if 'runas' in kwargs:
- cmd = f"su - {kwargs['runas']} -c \"{cmd}\""
+ def arch_chroot(self, cmd, run_as=None):
+ if run_as:
+ cmd = f"su - {run_as} -c {shlex.quote(cmd)}"
return self.run_command(cmd)