From 5af01fbf2849121d7c36a2208f1bb7dbdcacf476 Mon Sep 17 00:00:00 2001 From: Rudra Saraswat Date: Fri, 20 Jan 2023 11:49:37 +0530 Subject: [PATCH] add try-except to system-update for locking system --- blend | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/blend b/blend index 716babb..87fccaf 100755 --- a/blend +++ b/blend @@ -383,12 +383,16 @@ def update_blends(): error(f'distribution {args.distro} is not supported') def system_update(): - if args.noconfirm == True: - ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '--noconfirm', '-Syu']) - else: - ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '-Syu']) - subprocess.call(['sudo', 'almost', 'enter', 'ro']) - exit(ret) + try: + if args.noconfirm == True: + ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '--noconfirm', '-Syu']) + else: + ret = subprocess.call(['sudo', 'almost', 'run', '/usr/bin/pacman', '-Syu']) + subprocess.call(['sudo', 'almost', 'enter', 'ro']) + exit(ret) + except: + subprocess.call(['sudo', 'almost', 'enter', 'ro']) + exit(1) def enter_container(): if not distrobox_check_container(args.container_name):