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-08 13:45:30 +0200
committerLord Anton Hvornum <anton.feeds@gmail.com>2018-04-08 13:45:30 +0200
commit16ff533c81b0d9c92cd4fc2089e96ff4fa3f19a7 (patch)
tree2c70667d49f1331af3882fbba037e824fe8b0e55
parentcf6f6d94d00e7b156556f872f013fbb3ef798e45 (diff)
Improved sys exec to enable debug output via net deploy
-rw-r--r--archinstall.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/archinstall.py b/archinstall.py
index a48191ad..a16ff8fb 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -43,19 +43,20 @@ def get_local_MACs():
macs[addr.address] = nic
return macs
-def run(cmd, echo=False, *args, **kwargs):
+def run(cmd, echo=False, opts=None, *args, **kwargs):
+ if not opts: opts = {}
#print('[!] {}'.format(cmd))
handle = Popen(cmd, shell='True', stdout=PIPE, stderr=STDOUT, **kwargs)
output = b''
while handle.poll() is None:
data = handle.stdout.read()
if len(data):
- if echo and 'flush':
+ if echo or 'debug' in opts:
print(data.decode('UTF-8'), end='')
# print(data.decode('UTF-8'), end='')
output += data
data = handle.stdout.read()
- if echo:
+ if echo or 'debug' in opts:
print(data.decode('UTF-8'), end='')
output += data
handle.stdout.close()
@@ -297,7 +298,7 @@ if __name__ == '__main__':
opts = conf[title][command] if type(conf[title][command]) in (dict, oDict) else {}
#print('[N] Command: {} ({})'.format(command, opts))
- o = run('arch-chroot /mnt {c}'.format(c=command), **opts)
+ o = run('arch-chroot /mnt {c}'.format(c=command), opts)
if type(conf[title][command]) == bytes and len(conf[title][command]) and not conf[title][command] in o:
print('[W] Post install command failed: {}'.format(o.decode('UTF-8')))
#print(o)