diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2018-02-09 12:49:45 +0000 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2018-02-09 13:27:33 +0000 |
commit | f697957b0cdcdaca9e3c623fe9ffd4131ba75f12 (patch) | |
tree | a0cd93befaae76e6c289b0e4a59320d9c4a342f7 | |
parent | 3a0cc814c4f72c71894663aec37b88cc12bc3980 (diff) | |
download | ybd-f697957b0cdcdaca9e3c623fe9ffd4131ba75f12.tar.gz |
Improve error message on missing rpm/rpmbuild binaries
-rw-r--r-- | ybd/rpm.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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') |