Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Adam Mercer
Koji Packager
Commits
b9c70fc1
Verified
Commit
b9c70fc1
authored
May 14, 2019
by
Adam Mercer
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use logged_check_output() for querying rpm
parent
927860b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
gwkoji/rpm.py
gwkoji/rpm.py
+7
-4
No files found.
gwkoji/rpm.py
View file @
b9c70fc1
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment