add try-except to system-update for locking system

This commit is contained in:
Rudra Saraswat 2023-01-20 11:49:37 +05:30
parent d7763f0257
commit 5af01fbf28

16
blend
View file

@ -383,12 +383,16 @@ def update_blends():
error(f'distribution {args.distro} is not supported') error(f'distribution {args.distro} is not supported')
def system_update(): def system_update():
if args.noconfirm == True: try:
ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '--noconfirm', '-Syu']) if args.noconfirm == True:
else: ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '--noconfirm', '-Syu'])
ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '-Syu']) else:
subprocess.call(['sudo', 'almost', 'enter', 'ro']) ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '-Syu'])
exit(ret) subprocess.call(['sudo', 'almost', 'enter', 'ro'])
exit(ret)
except:
subprocess.call(['sudo', 'almost', 'enter', 'ro'])
exit(1)
def enter_container(): def enter_container():
if not distrobox_check_container(args.container_name): if not distrobox_check_container(args.container_name):