Verified Commit 25d91b11 authored by Adam Mercer's avatar Adam Mercer
Browse files

get package name from source rpm

parent f06b7960
......@@ -71,6 +71,16 @@ def check_connection_to_koji():
return
def get_package_name_from_source_rpm(srpm):
try:
cmd = ['rpm', '--queryformat', '%{NAME}', '-qp', srpm]
pkg_name = subprocess.check_output(cmd)
except subprocess.CalledProcessError as e:
print('Unable to determine package name, %s' % e)
sys.exit(1)
return pkg_name.decode()
#
# main program
#
......@@ -83,6 +93,10 @@ def main():
# check that we can authenticate to koji
check_connection_to_koji()
# get pkg name from source rpm
pkg_name = get_package_name_from_source_rpm(args.srpm)
print('package name = %s' % pkg_name)
#
# main program entry point
......
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