summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2018-02-09 12:49:45 +0000
committerBen Brown <ben.brown@codethink.co.uk>2018-02-09 13:27:33 +0000
commitf697957b0cdcdaca9e3c623fe9ffd4131ba75f12 (patch)
treea0cd93befaae76e6c289b0e4a59320d9c4a342f7
parent3a0cc814c4f72c71894663aec37b88cc12bc3980 (diff)
downloadybd-f697957b0cdcdaca9e3c623fe9ffd4131ba75f12.tar.gz
Improve error message on missing rpm/rpmbuild binaries
-rw-r--r--ybd/rpm.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ybd/rpm.py b/ybd/rpm.py
index 6764e49..d24827b 100644
--- a/ybd/rpm.py
+++ b/ybd/rpm.py
@@ -566,8 +566,13 @@ def package_rpms(system, whitelist=None):
# Fail now if missing `rpm` or `rpmbuild`
env_vars = sandbox.env_vars_for_build(system)
- sandbox.run_sandboxed(system, 'rpm --version', env_vars)
- sandbox.run_sandboxed(system, 'rpmbuild --version', env_vars)
+ test_cmds = ['rpm --version', 'rpmbuild --version']
+ for cmd in test_cmds:
+ error = sandbox.run_sandboxed(
+ system, cmd, env_vars, exit_on_error=False)
+ if error:
+ log('RPM-BUILD', 'To generate rpms, appropriate rpm and '
+ 'rpmbuild binaries are required', exit=True)
# First initialize the db
rpmdb_path = os.path.join(system['sandbox'], 'var', 'lib', 'rpm')