-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefakebuilddepslist
executable file
·51 lines (40 loc) · 1.22 KB
/
makefakebuilddepslist
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
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/python3
import deb822
import sys
deppackage = sys.argv[1];
builddeppackages = sys.argv[2:];
packageswithdep = set();
f = open("/home/repo/private/private/dists/buster-staging/main/binary-armhf/Packages")
for entry in deb822.Sources.iter_paragraphs(f):
package = entry['Package'];
#print(repr(entry))
if 'Depends' in entry:
deps = entry['Depends'].split(',')
for depstr in deps:
depname = depstr.lstrip().split(' ')[0]
if (depname == deppackage):
packageswithdep.add(package)
#print(repr(packageswithdep))
#sys.exit()
f = open("/home/repo/private/private/dists/buster-staging/main/source/Sources")
#f = open(sys.argv[2])
#fakelist = ()
for entry in deb822.Sources.iter_paragraphs(f):
package = entry['Package'];
foundbinary = False
binaries = entry['Binary'].split(',')
for binary in binaries:
binary = binary.strip()
if binary in packageswithdep:
foundbinary = True
if (foundbinary):
foundbuilddep = False
if 'Build-Depends' in entry:
builddeps = entry['Build-Depends'].split(',')
for depstr in builddeps:
depname = depstr.lstrip().split(' ')[0]
if depname in builddeppackages:
foundbuilddep = True
if not foundbuilddep:
print(package+': '+builddeppackages[0])
f.close()