Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2019-11-13 21:52:33 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2019-11-13 21:52:33 +0000
commitf9f6d890ae936c9a9eed79ef90b46e87c9395022 (patch)
treed635ff390b07f2bebebd7e11fbb39cd92dee7507 /archinstall.py
parent679e1bf58594a6014faee4d89aedb407ad87c234 (diff)
Added fix for #23. Not tested
Diffstat (limited to 'archinstall.py')
-rw-r--r--archinstall.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/archinstall.py b/archinstall.py
index 6a01a433..2ae7c747 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -75,7 +75,7 @@ except:
## FIXME: dependency checks (fdisk, lsblk etc)
def sig_handler(signal, frame):
- print('Aborting further installation steps!')
+ print('\nAborting further installation steps!')
print(' Here\'s a summary of the commandline:')
print(f' {sys.argv}')
@@ -420,11 +420,19 @@ def get_application_instructions(target):
instructions = {}
try:
instructions = grab_url_data('{}/applications/{}.json'.format(args['profiles-path'], target))
+ print('[N] Found application instructions for: {}'.format(target))
except urllib.error.HTTPError:
print('[N] No instructions found for: {}'.format(target))
- return instructions
+ print('[N] Trying local instructions under ./deployments/applications')
+ local_path = './deployments/applications' if isfile('./archinstall.py') else './archinstall/deployments/applications': # Dangerous assumption
+ if isfile(f'{local_path}/deployments/applications/{target}.json'):
+ with open(f'{local_path}/deployments/applications/{target}.json', 'r') as fh:
+ instructions = fh.read()
+
+ print('[N] Found local application instructions for: {}'.format(target))
+ else:
+ return instructions
- print('[N] Found application instructions for: {}'.format(target))
try:
instructions = json.loads(instructions.decode('UTF-8'), object_pairs_hook=oDict)
except:
@@ -438,11 +446,19 @@ def get_instructions(target):
instructions = {}
try:
instructions = grab_url_data('{}/{}.json'.format(args['profiles-path'], target))
+ print('[N] Found net-deploy instructions called: {}'.format(target))
except urllib.error.HTTPError:
print('[N] No instructions found called: {}'.format(target))
- return instructions
+ print('[N] Trying local instructions under ./deployments')
+ local_path = './deployments' if isfile('./archinstall.py') else './archinstall/deployments': # Dangerous assumption
+ if isfile(f'{local_path}/deployments/{target}.json'):
+ with open(f'{local_path}/deployments/{target}.json', 'r') as fh:
+ instructions = fh.read()
+
+ print('[N] Found local instructions called: {}'.format(target))
+ else:
+ return instructions
- print('[N] Found net-deploy instructions called: {}'.format(target))
try:
instructions = json.loads(instructions.decode('UTF-8'), object_pairs_hook=oDict)
except: