-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfedora-source-query
executable file
·40 lines (32 loc) · 1.14 KB
/
fedora-source-query
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
39
40
#!/usr/bin/env python
'''
Query Fedora build dependencies:
# Which packages have SDT tracepoints enabled?
fedora-source-query --whatrequires systemtap-sdt-devel
# NOTE: Since "sys/sdt.h" is a header only library,
# you can't get this information by querying the provies / requires in arch specific repositories
# Which packages depends on gtk3-devel to build?
fedora-source-query --whatrequires gtk3-devel
# which build dependencies does gtk3 itself have?
# Use an SRPM name here, ex: gtk3 instead of gtk3-devel
fedora-source-query --requires gtk3
'''
import sys
import os
import argparse
import subprocess
def main(args):
op = argparse.ArgumentParser(usage='%(prog)s (--requires | --whatrequires) PKG [PKG ...]')
op.add_argument('-r', '--rawhide', action='store_true')
(options, args) = op.parse_known_args(args)
if not args:
op.print_usage()
sys.exit(2)
if options.rawhide:
repoid = 'rawhide-source'
else:
repoid = 'fedora-source'
subprocess.check_call(['repoquery', '--repoid=' + repoid, '--archlist=src',
] + args)
if __name__ == '__main__':
main(sys.argv[1:])