Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-05 16:33:41 +0000
committerGitHub <noreply@github.com>2021-11-05 16:33:41 +0000
commite411ff0abb11cb0e9117555ada9e84d944dd5ea9 (patch)
treead8a88622b1d39572d8ea6d246cc5c48000093ab
parent3e53d45413a8a88ebea972a0d94edeb4b2445287 (diff)
parentbf5258892684c02ebf68cfdb5bbb56a5eddb5ae2 (diff)
Merged PR #680 - improved installation.arch_chroot()
Improved run_as for installation.arch_chroot()
-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 648ef50c..11a0f24e 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -2,6 +2,7 @@ import time
import logging
import os
import shutil
+import shlex
import pathlib
import subprocess
import glob
@@ -285,9 +286,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)