Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-07-06 22:20:34 +0200
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-07-06 22:20:34 +0200
commitf7d3022cc84eb30c90f4906f68c744d8f24f2132 (patch)
tree91bb222d1f43503858a7583d38caedf1ed500ed9 /archinstall/lib/general.py
parentdb528d86761ac8d8e1fc13be04d5c1d2e137fd8d (diff)
Reworked final preparations for working with profiles and installing them.
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 32814ddc..89c7f188 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -9,6 +9,20 @@ def log(*args, **kwargs):
def gen_uid(entropy_length=256):
return hashlib.sha512(os.urandom(entropy_length)).hexdigest()
+def multisplit(s, splitters):
+ s = [s,]
+ for key in splitters:
+ ns = []
+ for obj in s:
+ x = obj.split(key)
+ for index, part in enumerate(x):
+ if len(part):
+ ns.append(part)
+ if index < len(x)-1:
+ ns.append(key)
+ s = ns
+ return s
+
class sys_command():#Thread):
"""
Stolen from archinstall_gui
@@ -20,7 +34,10 @@ class sys_command():#Thread):
if kwargs['emulate']:
log(f"Starting command '{cmd}' in emulation mode.")
self.raw_cmd = cmd
- self.cmd = shlex.split(cmd)
+ try:
+ self.cmd = shlex.split(cmd)
+ except Exception as e:
+ raise ValueError(f'Incorrect string to split: {cmd}\n{e}')
self.args = args
self.kwargs = kwargs
if not 'worker' in self.kwargs: self.kwargs['worker'] = None