MCPcopy Index your code
hub / github.com/archlinux/archinstall / run

Function run

archinstall/main.py:110–173  ·  view source on GitHub ↗

This can either be run as the compiled and installed application: python setup.py install OR straight as a module: python -m archinstall In any case we will be attempting to load the provided script to be run from the scripts/ folder

()

Source from the content-addressed store, hash-verified

108
109
110def run() -> int:
111 """
112 This can either be run as the compiled and installed application: python setup.py install
113 OR straight as a module: python -m archinstall
114 In any case we will be attempting to load the provided script to be run from the scripts/ folder
115 """
116 arch_config_handler = ArchConfigHandler()
117
118 if '--help' in sys.argv or '-h' in sys.argv:
119 arch_config_handler.print_help()
120 return 0
121
122 match arch_config_handler.args.command:
123 case SubCommand.SHARE_LOG:
124 _share_log_command()
125 exit(0)
126 case None:
127 pass
128
129 script = arch_config_handler.get_script()
130
131 if script == 'list':
132 print(_list_scripts())
133 return 0
134
135 if os.getuid() != 0:
136 print(tr('Archinstall requires root privileges to run. See --help for more.'))
137 return 1
138
139 translation_handler.save_console_font()
140
141 _log_sys_info()
142
143 if not arch_config_handler.args.offline:
144 if not arch_config_handler.args.skip_wifi_check:
145 wifi_handler = WifiHandler()
146 else:
147 wifi_handler = None
148
149 if not _check_online(wifi_handler):
150 return 0
151
152 if not _fetch_arch_db():
153 return 1
154
155 if not arch_config_handler.args.skip_version_check:
156 upgrade = check_version_upgrade()
157
158 if upgrade:
159 text = tr('New version available') + f': {upgrade}'
160 info(text)
161 time.sleep(3)
162
163 if running_from_iso():
164 debug('Running from ISO (Live Mode)...')
165 else:
166 debug('Running from Host (H2T Mode)...')
167

Callers 1

mainFunction · 0.70

Calls 15

print_helpMethod · 0.95
get_scriptMethod · 0.95
ArchConfigHandlerClass · 0.90
trFunction · 0.90
WifiHandlerClass · 0.90
check_version_upgradeFunction · 0.90
infoFunction · 0.90
running_from_isoFunction · 0.90
debugFunction · 0.90
_share_log_commandFunction · 0.85
_list_scriptsFunction · 0.85
_log_sys_infoFunction · 0.85

Tested by

no test coverage detected