Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLord Anton Hvornum <anton.feeds@gmail.com>2018-04-07 16:51:18 +0200
committerLord Anton Hvornum <anton.feeds@gmail.com>2018-04-07 16:51:18 +0200
commit88b50f4dd317629a8ec49d8c127430c2d6a2396d (patch)
tree9352de2c614a501c4ca679eb688f6c690f528a5b
parent4933d474da012736d2a81a77133408847db5bbc3 (diff)
Improving the sys exec function
-rw-r--r--archinstall.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/archinstall.py b/archinstall.py
index 204a5f54..7fee4220 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -41,9 +41,9 @@ def get_local_MACs():
macs[addr.address] = nic
return macs
-def run(cmd, echo=False):
+def run(cmd, echo=False, *args, **kwargs):
#print('[!] {}'.format(cmd))
- handle = Popen(cmd, shell='True', stdout=PIPE, stderr=STDOUT)
+ handle = Popen(cmd, shell='True', stdout=PIPE, stderr=STDOUT, **kwargs)
output = b''
while handle.poll() is None:
data = handle.stdout.read()
@@ -263,8 +263,9 @@ if __name__ == '__main__':
for title in instructions:
print('[N] {}'.format(title))
for command in instructions[title]:
- print('[N] Command: {}'.format(command))
- o = run('arch-chroot /mnt {c}'.format(c=command), echo=True)
+ opts = instructions[title] if instructions[title] else {}
+ print('[N] Command: {} ({])'.format(command, opts))
+ o = run('arch-chroot /mnt {c}'.format(c=command), echo=True, **opts)
if instructions[title][command] and not instructions[title][command] in o:
print('[W] Post install command failed: {}'.format(o.decode('UTF-8')))
#print(o)