Verified Commit b9c70fc1 authored by Adam Mercer's avatar Adam Mercer 💬

use logged_check_output() for querying rpm

parent 927860b4
......@@ -19,12 +19,15 @@
"""Interactions with rpm
"""
import subprocess
from distutils.spawn import find_executable
from .utils import logged_check_output
# method to get the package name from the source
def get_package_name_from_source_rpm(source):
def get_package_name_from_source_rpm(*args, **kwargs):
rpm = find_executable('rpm')
cmd = [rpm, '--queryformat', '%{NAME}', '-qp', source]
return subprocess.check_output(cmd).decode()
if rpm is None:
raise FileNotFoundError("No such file or directory: 'rpm'")
cmd = (rpm, '--queryformat', '%{NAME}', '-qp',) + args
return logged_check_output(cmd, **kwargs).decode()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment