diff options
-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') |