Skip to content

Commit

Permalink
feat: attempt package installation just once
Browse files Browse the repository at this point in the history
  • Loading branch information
RudraSwat committed Aug 19, 2024
1 parent 60c06ce commit 388e0a4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions overlays/common/usr/bin/system
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,7 @@ Server = {package_repo["repo-url"]}
''')

if type(system_config.get('packages')) == list:
counter = 0
while True:
return_val = subprocess.run(['systemd-nspawn', '-D', new_rootfs, 'pacman', '-Sy', '--ask=4', *(system_config.get('packages'))])
counter += 1
if counter > 30:
print('e: failed to download packages')
exit(50)
if return_val == 0:
break
subprocess.run(['systemd-nspawn', '-D', new_rootfs, 'pacman', '-Sy', '--ask=4', *(system_config.get('packages'))])

subprocess.run(['mkdir', '-p', f'/.new.var.lib/commonarch'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
with open(f'/.new.var.lib/commonarch/revision', 'w') as new_revision_file:
Expand Down

0 comments on commit 388e0a4

Please sign in to comment.