From a4687095ed79431554cce3a57baba54213b7ddf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 28 Jan 2022 07:02:56 +0100 Subject: Add final output about which packages failed. --- main.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 2c7fc9f..9adcee4 100755 --- a/main.py +++ b/main.py @@ -244,6 +244,7 @@ def main(): logger.info('Installing from the repos: %s', repo_pkgs) subprocess_with_log(['sudo', 'pacman', *pacman_args, '-S', *repo_pkgs]) + failed_packages = [] for package in aur_pkgs: cmd = subprocess_with_log(['auracle', *auracle_args, '--chdir', cachedir, 'clone', package], capture_output=True, text=True) @@ -257,7 +258,16 @@ def main(): 'PATH': ':'.join(path), } extra_opts = pkg_options.get(package, []) - subprocess_with_log(['makepkg', *makepkg_args, *extra_opts, '--install', *pacman_args], env=env, cwd=cwd) + cmd = subprocess_with_log(['makepkg', *makepkg_args, *extra_opts, '--install', *pacman_args], env=env, cwd=cwd) + if cmd.returncode != 0: + failed_packages.append(package) + + if failed_packages: + logger.warning('The following packages failed: %s', + failed_packages) + else: + logger.info('All packages built successfully') + if __name__ == '__main__': if os.getuid() == 0: -- cgit v1.2.3