summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-28 07:02:56 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-28 07:02:56 +0100
commita4687095ed79431554cce3a57baba54213b7ddf5 (patch)
tree41beb8d85b7e1e8b4e71d1cb85a4abd5a2cf49e8
parentAdd possibility of options in package list. (diff)
downloadaur-runner-a4687095ed79431554cce3a57baba54213b7ddf5.tar.gz
aur-runner-a4687095ed79431554cce3a57baba54213b7ddf5.tar.xz
Add final output about which packages failed.
-rwxr-xr-xmain.py12
1 files changed, 11 insertions, 1 deletions
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: