forked from timlau/dnf-apiex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnf-filelist.py
40 lines (29 loc) · 935 Bytes
/
dnf-filelist.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from __future__ import absolute_import
from __future__ import print_function
import hawkey
import itertools
import sys
import dnf.subject
from base import DnfBase
class DnfExample(DnfBase):
'''
This examples shows how to use the dnf.subject.Subject to
find packages matching a wildcard like yum*
'''
def __init__(self):
DnfBase.__init__(self)
if len(sys.argv) < 2:
print("USAGE: dnf-updateinfo <packagename>")
sys.exit(1)
key = sys.argv[1]
subj = dnf.subject.Subject(key)
qa = subj.get_best_query(self.sack, with_provides=False)
qa = qa.available()
print("==== latest matching {} =====".format(key))
for pkg in qa.run():
print("pkg : %-40s repo : %-20s" % (pkg, pkg.reponame))
files = pkg.files
print("\n".join(files))
if __name__ == "__main__":
de = DnfExample()
del de